Re: Can I have If...Else inside a For Loop???
| From: | Brad Melendy | Date: | Sun, 21 Oct 2001 02:47:34 +0000 |
| Subject: | Re: Can I have If...Else inside a For Loop??? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71716@lists.php.net to get a copy of this message | ||
Oops, I spoke too soon. I wasn't getting the results I thought I was until
I used "==" instead of "=" at the very end of my IF statement. Thanks very
much for pointing that out.
....Brad
"Brad Melendy" <brad@techkno.com> wrote in message
news:20011020180751.17844.qmail@pb1.pair.com...
> Hmmmm..... dunno about that. It's returning the results I'd expect as it
is
> now. If I pass a string with characters that don't match the IF's
criteria,
> I'm getting the ELSE statement's results. Thanks though.
>
> ....Brad
>
> "~~~I Leonid ~~" <nux@auto_no.mailru.com> wrote in message
> news:3bd15547.14743496@localhost...
> > On Fri, 19 Oct 2001 21:46:29 -0700 impersonator of brad@techkno.com
(Brad
> > Melendy) planted &I saw in php.general:
> >
> > >AAAAaaaaarrrrrrgggghhhhh! I don't think I can say much else. Thanks
so
> > >much for pointing that out David. ;-)
> > >
> > >.....Brad
> > >
> > >
> > >"David Pearson" <David@Pearson-Family.org> wrote in message
> > >news:003101c1591a$e00ec290$320110ac@david...
> > >> Could it be the semi colon at the end of the 'if' line, at '...
$nChar
> =
> > >> 45); { ...' ? Looks like the if statement ends there, the ' { print
> > >> "OK."; } ' is a block on it's own and the 'else' is
> > >> now out of
context.
> > >>
> > >> -----Original Message-----
> > >> From: Brad Melendy [mailto:brad@techkno.com]
> > >> Sent: Friday, October 19, 2001 8:03 PM
> > >> To: php-general@lists.php.net
> > >> Subject: [PHP] Can I have If...Else inside a For Loop???
> > >>
> > >>
> > >> Hi All,
> > >> I'm stumped. I've got the following code:
> > >>
> > >> <?php
> > >> if(isSet($domain))
> > >> {
> > >> for ( $counter=0; $counter <= strlen($domain); $counter++ )
> > >> {
> > >> $nChar = ord(strtolower(substr($domain, $counter, 1)));
> > >> if (($nChar > 47 And $nChar < 58) or ($nChar > 96 And $nChar < 123)
> or
> > >> $nChar = 45);
> > I'd also ^^put == here, or you NEVER get to else{ anyway
>
>