I'm looking for a more elegant way of doing this:
if (($x==$a) || ($x==$b) || ($x==$c))
Is there any way of saying "if $x is in this array", or something similar.
Thanks,
Antun http://www.antunkarlovac.com/
use in_array() http://www.php.net/manual/en/function.in-array.php
<? $vars = array ($a, $b, $c); if (in_array ($x, $vars)) {echo "$x is in the array";} else {echo "$x is not in the array";} ?>