Re: test variable value?

From: Date: Wed, 11 Jan 2006 23:48:14 +0000
Subject: Re: test variable value?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-228505@lists.php.net to get a copy of this message
If your talking values in submitted form data I would use: if(isset($var) && trim($var) == '') { echo "Please give a value"; } James William Stokes wrote:
Hello What is the best way to determine if a variable has no value? if ($var= '') or if ($var= 'null') Can 'null' be used here? Thanks -Willa


« previous php.general (#228505) next »