Re: minimum version of php supported
| From: | Marshall Roch | Date: | Mon, 05 Jan 2004 17:45:07 +0000 |
| Subject: | Re: minimum version of php supported | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24795@lists.php.net to get a copy of this message | ||
Daniel Convissor wrote:
I'd like to take advantage of array_search() in some of the DB classes. This function was introduced in 4.0.5. I trust this version is sufficiently old enough considering it was released on 2001-04-30.You could do something like this to emulate array_search() if it doesn't exist: if (!function_exists('array_search')) { function array_search($needle, $haystack) { $match = false; foreach ($haystack as $key => $value) {
if ($value == $needle) {
$match = $key;
}
}
return $match;
}
}
(found this function in the array_search() comments at php.net)
--
Marshall Roch