$posible_values = array("this value", "that value", "other value"); if (in_array($thisvalue, $posible_values)) { // $thisvalue is in $posible_values } else { // $thisvalue is NOT in $posible_values }
Cesar
I wrote:
<corection to last post>But then... you have to use "and" not "or" like:</corection to last post>
if (($thisvar != "this value") and ($thisvar != "thatvalue")) { // do stuff }
Cesar Cordovez wrote:
if (($thisvar != "this value") or ($thisvar != "thatvalue")) { // do stuff }
cesar =)
Ed Curtis wrote:
How would I write this statement:
if $thisvar is not equal to this value or that value. { do stuff }
Thanks,
Ed
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php