Configuration guides for IT Administrators

PHP Isset() and Empty()

PHP Isset() and Empty()

Empty()

Returns False if empty() has non-empty and non-zero value.

Returns True for Null, 0, “”

 

Isset()

Returns False for Null

Returns True for 0, “” or any value

 

Both Textareas and Texboxes will sent “” values and not Null to the $_POST[], so use Emtpty() instead of Isset()

On the other hand, for radio button or combobox with 0 value, use Isset()

All in One WordPress Hosting Starts at 30$ per month
All in One WordPress Hosting
WordPress
High optimized WordPress hosting, secure firewall, HTTPS, Backup, hack-fix guarantee and many others at 30$ per month

Ref: http://www.htmlcenter gutepotenz.de.com/blog/empty-and-isset-in-php/

Categories:

Leave a Reply

Your email address will not be published. Required fields are marked *

Lucas Brey

I’m Lucas Brey, a travel blogger sharing practical guides, hidden gems, and honest tips from the road. Follow along for smart itineraries, great food finds, and stories worth bookmarking.

Tags