note 42914 added to function.empty
| From: | stry_cat at yahoo dot com | Date: | Thu, 03 Jun 2004 12:31:11 +0000 |
| Subject: | note 42914 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70504@lists.php.net to get a copy of this message | ||
Someone said:
"The isset() function is very helpful to find if a form field was submitted as blank. I could
give an example but I think somebody alreay did in here.
My point is that isset() and empty() are redundant but they do allow you to program in
error_reporting(E_ALL) without warnings or notices, which usually means more secure scripts..."
Responce:
This is incorrect. If a form field is left blank when submitted,
isset($_REQUEST["field"]) will return true b/c there is a blank/null in the field.
However empty($_REQUEST["field"]) will also return true b/c there is a blank/null in the
field. isset is not helpful in this case. empty is extremely helpful.
----
Manual Page -- http://www.php.net/manual/en/function.empty.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42914
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42914&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42914&report=yes
Search -- http://master.php.net/manage/user-notes.php