Jump to content

empty variables?


TeddyKiller

Recommended Posts

empty() will have covered if the variable is an empty string or undefined. Don't use if (!$user) { }. However, be careful with empty() because it also returns TRUE for the integer 0 and string "0". For more details on empty(), take a look at the empty() PHP Manual page. Depending on your scenario, you might want to look at isset().

 

-D

Link to comment
https://forums.phpfreaks.com/topic/199514-empty-variables/#findComment-1047176
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.