kurt.santo Posted July 1, 2007 Share Posted July 1, 2007 I understand that the isset () function tests if a variable has a value. But I do not understand that this includes 0, false or an empty string, but not null? What is the difference between 0 and null anyhow? And how can an empty string be a value? kurt Link to comment https://forums.phpfreaks.com/topic/57948-solved-php-isset-function/ Share on other sites More sharing options...
trq Posted July 1, 2007 Share Posted July 1, 2007 I understand that the isset () function tests if a variable has a value. Then you understand incorrectly. isset test to see if a variable has been defined. What is the difference between 0 and null anyhow? 0 is the value 0. NULL is the absense of any value. Link to comment https://forums.phpfreaks.com/topic/57948-solved-php-isset-function/#findComment-287179 Share on other sites More sharing options...
no_one Posted July 1, 2007 Share Posted July 1, 2007 isset() tests if a variable is valid & exists. "" ~= "\0" as far as I know, valid but empty (0). If you need to know if a variable has a value use empty() [edit]: Or, uh, what Thorpe said Link to comment https://forums.phpfreaks.com/topic/57948-solved-php-isset-function/#findComment-287183 Share on other sites More sharing options...
kurt.santo Posted July 2, 2007 Author Share Posted July 2, 2007 Cheers. Now it makes sense Kurt Link to comment https://forums.phpfreaks.com/topic/57948-solved-php-isset-function/#findComment-287719 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.