note 21919 deleted from function.array-key-exists by philip
| From: | philip@php.net | Date: | Fri, 06 Dec 2002 17:22:16 +0000 |
| Subject: | note 21919 deleted from function.array-key-exists by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40435@lists.php.net to get a copy of this message | ||
This workaround is not working if the array is not defined. The original function in PHP 4.1 is.
This version seems to be OK :
if (phpversion() < '4.1') {
eval('function array_key_exists($key, $arr)
{
if (!is_array($arr))
return false;
foreach (array_keys($arr) as $k)
if ($k == $key)
return true;
return false;
}');
}