Jump to content

comapre zero with unassigned variable


abdfahim

Recommended Posts

Hi,

 

A quick help needed. I have the following code

 

if($var==0){
return $var;
}

 

Here, if $var is assigned to zero or $var is not assigned, both cases returns true. I want only to return true when $var is assigned to zero, false otherwise. I dont want to use empty or isset function.

 

Thanks,

Link to comment
https://forums.phpfreaks.com/topic/215000-comapre-zero-with-unassigned-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.