Re: if question
| From: | Justin French | Date: | Tue, 17 Dec 2002 13:30:39 +0000 |
| Subject: | Re: if question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128551@lists.php.net to get a copy of this message | ||
Not sure if 'OR' works... I use a double pipe/vertical bar ('||') for
'OR'
<?
$stelle_who = '4';
if(($stelle_who != '1') || ($stelle_who != '2') || ($stelle_who !=
'3') ||
($stelle_who != '5')) {
echo "success";
}
?>
Jus to point out the really obvious... in the above example, the following
would also work:
<?
$stelle_who = '4';
if($stelle_who == '4') {
echo "success";
}
?>
Cheers,
Justin
on 18/12/02 12:04 AM, John Fishworld (john@webital.de) wrote:
> Help !
>
> Can anyone tell me why this doesn't seem to work ??
>
> if (($stelle_who != '1') OR ($stelle_who != '2') OR ($stelle_who !=
> '3') OR
> ($stelle_who != '5') ) {
>
> and what can i use as an alternative syntex ??
>
> thanks in advance
>
>
Justin French
--------------------
http://Indent.com.au
Web Development &
Graphic Design
--------------------