Re: [PHP] testing if var is empty

2001-07-21 Thread Dave Freeman
On 21 Jul 01, at 14:50, Saquib Farooq wrote: > > if ($var) > > { > > // $var has been set > > } else { > > // $var has not been set > > } > what if the var is set to zero i.e. false. the control will go in > the else part if it is not zero ( not false) it will go in the if control.

Re: [PHP] testing if var is empty

2001-07-21 Thread Stefan Rusterholz
Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: "Saquib Farooq" <[EMAIL PROTECTED]> To: "Dave Freeman" <

Re: [PHP] testing if var is empty

2001-07-21 Thread Saquib Farooq
On Sat, 21 Jul 2001, Dave Freeman wrote: > On 21 Jul 01, at 12:07, Justin French wrote: > > > I'm a semi-newbie, and if I want to check if a variable is set, or > > contains something, i've been doing it like this: > > > > if($var != "") { ... } > > if ($var) > { > // $var has been set >

Re: [PHP] testing if var is empty

2001-07-21 Thread Dave Freeman
On 21 Jul 01, at 12:07, Justin French wrote: > I'm a semi-newbie, and if I want to check if a variable is set, or > contains something, i've been doing it like this: > > if($var != "") { ... } if ($var) { // $var has been set } else { // $var has not been set } will do what yo

Re: [PHP] testing if var is empty

2001-07-20 Thread Rasmus Lerdorf
http://php.net/empty On Sat, 21 Jul 2001, Justin French wrote: > Hi, > > I'm a semi-newbie, and if I want to check if a variable is set, or > contains something, i've been doing it like this: > > if($var != "") { ... } > > I'm sure there is a better/safer/smarter/faster/more reliable way? > > >

[PHP] testing if var is empty

2001-07-20 Thread Justin French
Hi, I'm a semi-newbie, and if I want to check if a variable is set, or contains something, i've been doing it like this: if($var != "") { ... } I'm sure there is a better/safer/smarter/faster/more reliable way? Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe,