Hi, Friday, February 7, 2003, 4:39:42 AM, you wrote: JW> On Friday 07 February 2003 01:35, [EMAIL PROTECTED] wrote: >> Thanks for clearing that up.
JW> Hmm, it seems like you still haven't grasped it yet :) >> So input of type text does a set, which makes >> isset() true, JW> Correct. >> but isset() does not return true if $var is merely empty. JW> Incorrect. Basically empty($var) returns TRUE if $var evaluates to FALSE, and JW> in this context if $var is undefined it evaluates to FALSE. isset($var) JW> returns TRUE if $var has been defined & is a non-NULL value, and returns JW> FALSE if $var is undefined or is set to NULL. JW> -- Jason Wong ->> Gremlins Associates -> www.gremlins.biz JW> Open Source Software Systems Integrators JW> * Web Design & Hosting * Internet & Intranet Applications Development * JW> ------------------------------------------ JW> Search the list archives before you post JW> http://marc.theaimsgroup.com/?l=php-general JW> ------------------------------------------ JW> /* JW> Conquering Russia should be done steppe by steppe. JW> */ Here is a bit of code that will make it as clear as mud: echo '<br>Start Test <br>'; for($x=1;$x<5;$x++){ if (isset($test)){ echo $x.' $test is set. <br>'; if(!empty($test)){ echo $x.' Not empty check returns not empty ('.$test.'). <br>'; }else{ echo $x.' Not empty check returns empty ('.$test.'). <br>'; } if(empty($test)){ echo $x.' $test is empty ('.$test.'). <br>'; }else{ echo $x.' $test contains '.$test.'<br>'; } }else{ echo $x.' $test is not set yet. <br>'; } if($x == 1){ if(empty($test)){ echo $x.' Empty check returns empty. <br>'; }else{ echo $x.' Empty check returns not empty. '.$test.'<br>'; } if(!empty($test)){ echo $x.' Not empty check returns not empty. <br>'; }else{ echo $x.' Not empty check returns empty. <br>'; } $test = ''; } if($x == 2){ $test = 0; } if($x == 3){ $test = $x; } echo '<br>'; } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php