[PHP] elseif without else

2002-02-28 Thread Erik Price
For any of you PHP legal eagles: I rtfm'd, but the "elseif" page doesn't say -- is it okay to have if ($x) { // do something } elseif ($y) { // do something } elseif ($z) { // do something } without a final "else"? My code works fine -- so I know that you -can- do this. What I was wondering

Re: [PHP] elseif without else

2002-02-28 Thread Jeff Sheltren
If you are setting a variable inside of the if statements, and then checking that variable later, then I would say you should either use an else statement to give that variable a default value, or you should set the variable to a default value before the if statements. Your code is "legitimat

Re: [PHP] elseif without else

2002-02-28 Thread Dennis Moore
Perfectly legitimate... it is much like having a switch statement without a default clause. - Original Message - From: "Erik Price" <[EMAIL PROTECTED]> To: "PHP (E-mail)" <[EMAIL PROTECTED]> Sent: Thursday, February 28, 2002 7:32 PM Subject: [PHP] el

RE: [PHP] elseif without else

2002-02-28 Thread Martin Towell
if there's nothing to do in the else block, then it's a bit pointless to have one eg value="xxx" name="blah"> see what I mean? Martin -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 11:32 AM To: PHP Subject

Re: [PHP] elseif without else

2002-02-28 Thread Erik Price
On Thursday, February 28, 2002, at 07:56 PM, Dennis Moore wrote: > Perfectly legitimate... it is much like having a switch statement > without a > default clause. > Oh, I didn't know that that was legitimate either. :) Thanks Dennis Erik Erik Price Web Developer Temp Media Lab, H.

Re: [PHP] elseif without else

2002-02-28 Thread Erik Price
On Thursday, February 28, 2002, at 07:42 PM, Jeff Sheltren wrote: > If you are setting a variable inside of the if statements, and then > checking that variable later, then I would say you should either use an > else statement to give that variable a default value, or you should set > the va

RE: [PHP] elseif without else

2002-02-28 Thread Martin Towell
2002 11:59 AM To: Jeff Sheltren Cc: PHP Subject: Re: [PHP] elseif without else On Thursday, February 28, 2002, at 07:42 PM, Jeff Sheltren wrote: > If you are setting a variable inside of the if statements, and then > checking that variable later, then I would say you should either use an