note 33305 added to function.isset
| From: | Rob at rack1 dot php dot net | Date: | Sat, 21 Jun 2003 23:59:15 +0000 |
| Subject: | note 33305 added to function.isset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50801@lists.php.net to get a copy of this message | ||
Something I've discovered that may be causing others some unneeded distress is that the
following code (for an unknown reason) does not work:
<CODE>
if (isset($db->f("someKey")))
{
// do something with this key/variable combo
}
</CODE>
However, it will work if you initialize a new variable to use the value stored in
$db->f("someKey"), like so:
<CODE>
$someKey = $db->f("someKey");
if (isset($someKey) && $someKey!='')
{
// do something with this variable stuff
}
</CODE>
----
Manual Page -- http://www.php.net/manual/en/function.isset.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33305
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33305&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33305&report=yes