PHP 5: création et utilisation des constructeurs

Author:


Download

<?php
 class Articles {
   var $nom;

   function Articles( $nom="Articles") {
     $this->nom = $nom;
   }

   function modifierNom( $n) {
     $this->nom = $n;
   }

   function afficherNom () {
     return $this->nom;
   }
 }

 $Articles = new Articles("PC portable");
 print $Articles->afficherNom ();
?>

Leave a Reply

Your email address will not be published. Required fields are marked *


6 − = three