Premier commit

This commit is contained in:
Logshiro
2025-09-29 13:11:49 +02:00
commit 59d0786bc3
4 changed files with 90 additions and 0 deletions

44
Etudiant.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
Class Etudiant{
private $nom;
private $prenom;
private $age;
public function __construct($nom,$prenom,$age){
$this->nom = $nom;
$this->prenom = $prenom;
$this->age = $age;
}
public function afficherHtml(){
echo "Etudiant2 :<br>". "Nom : ".$this->getNom()."<br>"
."Prenom : ".$this->getPrenom()."<br>"."Age : ".$this->getAge()."<br>";
}
//accès en écriture (setter)
public function setNom($nom){
$this->nom = $nom;
}
public function setPrenom($prenom){
$this->prenom = $prenom;
}
public function setAge($age){
$this->age = $age;
}
public function getNom(){
return $this->nom;
}
public function getPrenom(){
return $this->prenom;
}
public function getAge(){
return $this->age;
}
}