--- Adam Williams <[EMAIL PROTECTED]> wrote:
> I need to test a variable to see if it contains a value or not, and if
> not, do something. My php is a little rusty, so which would be better?
This is a good page for understanding how things like isset(), is_null(),
and empty() work:
http://www.bl
Adam Williams said the following on 11/12/2003 11:37 AM>>
Hello,
I need to test a variable to see if it contains a value or not, and if
not, do something. My php is a little rusty, so which would be better?
if ( !$var )
{ echo "do something";}
or
if ( !isset($var )
{ echo "do something";}
or a
From: "Adam Williams" <[EMAIL PROTECTED]>
> I need to test a variable to see if it contains a value or not, and if
> not, do something.
[snip]
> if ( !isset($var )
> { echo "do something";}
That's the correct way.
> What I am doing is checking a field in an sql table, and if the field is
> nul
[snip]
if ( !isset($var )
{ echo "do something";}
[/snip]
self answering questions, gotta' love 'em!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
4 matches
Mail list logo