If there is a large amount of if statements, say that I have to compare each element of a big array with a lot of case (eg 100 test cases), is there a more efficient way to search through the case
$x[0] //user input
if($x[0] == 1)
dosomething();
elseif ($x[0] ==2)
thing1();
....
elseif($x[0] == 100)
thing100();
Aucun commentaire:
Enregistrer un commentaire