php3-list | 199901
Date: 01/08/99
- Next message: Sander Pilon (3DNews): "RE: [PHP3] Installation"
- Previous message: Chad Cunningham: "Re: [PHP3] Authorization options"
- In reply to: Brian Schaffner: "RE: [PHP3] 'OR' problem"
- Next in thread: Colin Viebrock: "RE: [PHP3] 'OR' problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
No, the if (): else: endif; is perfectly acceptable PHP. It's just
not used as often.
At 8:37 AM -0500 1/8/99, Brian Schaffner wrote:
> uhmm... i don't recall the : being added to work like you're using it.
> Your code should really look more like this:
> <?php
> $var1="A";
> $var2="X";
> if ($var1=="A" || $var2 =="B") {
> echo "true";
> } else {
> echo "false";
> }
> ?>
>
> -brian-
>
>> -----Original Message-----
>> From: Tony McDonald [mailto:tony.mcdonald <email protected>]
>> Sent: Friday, January 08, 1999 8:27 AM
>> To: php3 <email protected>
>> Subject: Re: [PHP3] 'OR' problem
>>
>>
>> > Hi
>> >
>> > Is there a problem with using '||' ?
>> >
>> > The following doesn't ever want to return true:
>> >
>> > $var1="A";
>> > $var2="X";
>> > if ($var1=="A" || $var2 =="B")
>> > ....
>> >
>> > Remove the second part of the || and it will work okay. Using PHP
>> > V3.0.1. Couldn't see a fix in the change log but maybe I missed it.
>>
>> <?php
>> $var1="A";
>> $var2="X";
>> if ($var1=="A" || $var2 =="B"):
>> echo "true";
>> else:
>> echo "false";
>> endif;
>> ?>
>> returns true on a PHP 3.0.6 system...better upgrade.
>> tone
>> ------
>> Dr Tony McDonald, FMCC, The Medical School, Newcastle University
>> Tel: +44 191 222 5888 Fax +44 191 222 5016
>> Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
>>
>> --
>> PHP 3 Mailing List http://www.php.net/
>> To unsubscribe send an empty message to php3-unsubscribe <email protected>
>> To subscribe to the digest list: php3-digest-subscribe <email protected>
>> For help: php3-help <email protected> Archive:
>> http://www.php.net/mailsearch.php3
>> List administrator: zeev <email protected>
>>
>>
>
> --
> PHP 3 Mailing List http://www.php.net/
> To unsubscribe send an empty message to php3-unsubscribe <email protected>
> To subscribe to the digest list: php3-digest-subscribe <email protected>
> For help: php3-help <email protected> Archive:
> http://www.php.net/mailsearch.php3
> List administrator: zeev <email protected>
--------------------------------------------------------------------------
Chad Cunningham, Systems Developer | ccunning <email protected>
Math-Stats Learning Center | ccunning <email protected>
Ohio-State University | cunningh <email protected>
Department of Mathematics | 614-292-8434
--------------------------------------------------------------------------
PGP Public Key available at http://socrates.mps.ohio-state.edu/~ccunning
"Power corrupts. Absolute power is pretty neat."
-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev <email protected>
- Next message: Sander Pilon (3DNews): "RE: [PHP3] Installation"
- Previous message: Chad Cunningham: "Re: [PHP3] Authorization options"
- In reply to: Brian Schaffner: "RE: [PHP3] 'OR' problem"
- Next in thread: Colin Viebrock: "RE: [PHP3] 'OR' problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

