1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
<?php
class item {
$nom;
$prenom;
$age;
/** Le constructeur*/
public function __construct($n,$p$a)
{
$this->nom=$n;
$this->prenom=$p;
$this->age=$a;
}
}
//////////////////////////////////
$i1 =new item("blpha","prenom",25);
$i2 =new item("ag","prenom",25);
$i3 =new item("a","prenom",25);
$listOfItem ;
listOfItems[] = $i1;
listOfItems[] = $i2;
listOfItems[] = $i3;
// ici je cherche une fonction a triè listOfItems selon le NOM ou prénom ou age !:( |
Partager