Re: Stupid newbee question.
| From: | Ed Warvel | Date: | Sat, 29 Jul 2000 04:03:30 +0000 |
| Subject: | Re: Stupid newbee question. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8914@lists.php.net to get a copy of this message | ||
OK, Thanks! I guess I better start counting my brackets, commas, quotes,
etc., etc..
Ed
"Sam Carleton" <scarleton@activex-dev.com> wrote in message
news:39823265.24360BA0@activex-dev.com...
> Ed Warvel wrote:
> >
> > Can you put an if/else pair inside the if or else of an outer pair. In
other
> > words could I do this:
> >
> > if (whatever){
> > If (whatever){
> > blah blah;
> > }Else{
> > blah blah;
> > }
> > }else{
> > If (whatever){
> > blah blah;
> > }Else{
> > blah blah;
> > }
> > }
> >
> > If the answer is yes and this should not cause any problems then I
probably
> > am missing a comma or quote or something else that just doesn't cause a
> > problem until the code gets to the outer level else. If this doesn't
work is
> > there a way around doing this, or maybe a different syntax I should be
> > using. I'm a Cold Fusion programmer and I know I can nest if/else pairs
to
> > my hearts content (as long as I can keep track of the brackets) in that
> > language, but I'm very new to PHP so I'm wondering if it has different
ways
> > of doing this sort of thing.
>
> You are allowed to nest if statements with one another. You would be in
> some seious hurt if you couldn't, IMO. I program in a number of
> languages C/C++/VB/Java/javaScript/Perl, they ALL allow nested if
> statements. They also allow nesting of any type of conditional
> if/switch/while/do. The only language that doesn't, that I know of, is
> Assembly, but then you don't have any of those conditionals:) Life is
> very different in assembly:)
>
> Sam
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>