I have an array of numbers i.e.
$which_ones[] = 1,3,5,9
is there a single call to do the following
if ($which_ones HAS $x) { //$x is present in £which_ones }
regards
Maybe this will work:
$biglist = " ".implode(", ",$which_ones).",";
if (strstr($biglist," ".$x.",")) { //$x is present in the array. }
Let me know how it works!
i believe that the function you are looking for in in_array(). please read the documentation of this funtion at http://www.php.net/manual/en/function.in-array.php
if (in_array($x, $which _ones) { }
http://www.php.net/manual/en/function.in-array.php
Sorry about that,
I had looked through the manual but completly missed that entry,
sorry again,
pgudge
I'm learning new functions all the time.
Thanks!