note 23490 added to function.in-array
| From: | nicolaszujev at hot dot ee | Date: | Fri, 19 Jul 2002 13:40:58 +0000 |
| Subject: | note 23490 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33305@lists.php.net to get a copy of this message | ||
I wrote this function to check key in array and also check value if it exists...
function in_array_key($key, $array, $value = false)
{
while(list($k, $v) = each($array))
{
if($key == $k)
{
if($value && $value == $v)
return true;
elseif($value && $value != $v)
return false;
else
return true;
}
}
return false;
}
.. very helpful function ...
--
http://www.php.net/manual/en/function.in-array.php
http://master.php.net/manage/user-notes.php?action=edit+23490
http://master.php.net/manage/user-notes.php?action=delete+23490
http://master.php.net/manage/user-notes.php?action=reject+23490