Eléphant du PHP |
54 Messages
23 juin 2005, 18:39
Pour plusieur valeur tu peux fair :
<?php
if (($row_rsMotsclefs['catID'] == "14")&&($row_rsMotsclefs['catID'] == "15")){ //si $row_rsMotsclefs['catID'] est eguale à 14 et 15
echo($row_rsMotsclefs['catID']== "14" ? "fiche2" : "fiche1");
}
if (($row_rsMotsclefs['catID'] >= "14")&&($row_rsMotsclefs['catID'] <= "17")){ //si $row_rsMotsclefs['catID'] est saperieur à 14 et inferieur à 17
echo($row_rsMotsclefs['catID']== "14" ? "fiche2" : "fiche1");
}
if (($row_rsMotsclefs['catID'] == "14")||($row_rsMotsclefs['catID'] == "15")){ //si $row_rsMotsclefs['catID'] et eguale à 14 ou 15
echo($row_rsMotsclefs['catID']== "14" ? "fiche2" : "fiche1");
}
if (($row_rsMotsclefs['catID'] >= "14")||($row_rsMotsclefs['catID'] <= "17")){ //si $row_rsMotsclefs['catID'] est saperieur à 14 ou inferieur à 17
echo($row_rsMotsclefs['catID']== "14" ? "fiche2" : "fiche1");
}
?>
Modifié en dernier par
benjamin le 25 juin 2005, 12:59, modifié 1 fois.