note 49759 added to ref.strings
| From: | roelfyatlycosdotnl at osu1 dot php dot net | Date: | Tue, 08 Feb 2005 04:09:16 +0000 |
| Subject: | note 49759 added to ref.strings | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-84644@lists.php.net to get a copy of this message | ||
if the variable $memberid contains a zero, and you use:
if($memberid != '') ....
the outcome is false because somehow '0' becomes '' (empty) somehow
i found a solution for this:
if("$memberid"!='') ....
the above expression will distinguish between 0 (zero) and '' (empty string)
it cost me 1 nightly hour so i hope it helps someone else
----
Manual Page -- http://www.php.net/manual/en/ref.strings.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49759
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49759&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49759&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49759&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49759&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49759&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49759&report=yes
Search -- http://master.php.net/manage/user-notes.php