the no variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eron
Forum Newbie
Posts: 1
Joined: Mon Nov 02, 2009 2:27 pm

the no variable

Post by eron »

Hi does anyone know why my php setup does not understand the no variable.
if(!$variable){

thanks in advance
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: the no variable

Post by Christopher »

Moved to PHP Code.

What do you mean "my php setup does not understand" if(!$variable){ ?? What does it do? Or not do?
(#10850)
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: the no variable

Post by AbraCadaver »

eron wrote:Hi does anyone know why my php setup does not understand the no variable.
if(!$variable){

thanks in advance
if(!$variable){
echo "NOT";
}

Will display NOT if $variable = 0, '', false, null or if $variable has not been set. What does $variable contain?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply