Re: if elseif elseif elseif....
| From: | PJ | Date: | Wed, 04 Mar 2009 23:13:01 +0000 |
| Subject: | Re: if elseif elseif elseif.... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289306@lists.php.net to get a copy of this message | ||
Daniel Brown wrote:
> On Wed, Mar 4, 2009 at 17:51, PJ <af.gourmet@videotron.ca> wrote:
>
>> elseif ($obligatoryFieldNotPresent = 1) {
>> $obligatoryFieldNotPresent = 0;
>> }
>>
>
> Are you certain you only wanted a single equal operator in the
> last elseif() condition? Further, are you sure it should even be an
> elseif() and not a straight else?
>
>
That's where the problem lies... the algorhythm is if any one of a
series is empty, then it's an error, but if they are all ls then we go on...
So the last one should show up as "0"...
I tried else $obligatoryFieldNotPresent = 0; but that doesn't want to
work. I tried echo $obligatoryFieldNotPresent;
just get a blank page...
I can't figure out how to determine if anything is in the String...
perhaps I should be checking for null
elseif ($obligatoryFiledNotPresent == "") {
$obligatoryFieldNotPresent = 0;
}
I tried that too, but same result...
--
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- pj@ptahhotep.com
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php