note 50151 added to function.strcmp
| From: | element at nospamdotnet | Date: | Sat, 19 Feb 2005 23:42:38 +0000 |
| Subject: | note 50151 added to function.strcmp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85249@lists.php.net to get a copy of this message | ||
When using strcmp to compare results received from a form, keep in mind that the way you decide to
encapsulate the value of the form will have an effect on your strcmp() results.
Example:
<input type="post" name="user[0]" value="abc">
<input type="post" name="user[1]" value='abc'>
strcmp() will not return the values sent from this form as "0".
However, by using single-quotes or double-quotes to encapsulate BOTH values, strcmp() will return a
"0" result.
----
Manual Page -- http://www.php.net/manual/en/function.strcmp.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50151
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50151&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50151&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50151&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50151&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50151&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50151&report=yes
Search -- http://master.php.net/manage/user-notes.php