|
Posted by Toby A Inkster on 02/01/07 10:28
Uleric wrote:
> if ($myzone !== ("here") or ("there") or ("where")) { die: }
Try:
if ($myzone!='here' && $myzone!='there' && $myzone!='where') die;
Or, using De Morgan's Laws (boolean algebra law concerning the
relationship between NOT, AND and OR) you could alternatively use:
if (!( $myzone=='here' || $myzone=='there' || $myzone=='where' )) die;
Or, to make your code read a bit more sanely (but might actually run
slower!):
$allowed_states = array('here', 'there', 'where');
if (!in_array($myzone, $allowed_states)) die;
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Navigation:
[Reply to this message]
|