Re: "searching" arrays
| From: | Raphael Pirker | Date: | Wed, 15 Aug 2001 06:47:46 +0000 |
| Subject: | Re: "searching" arrays | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62775@lists.php.net to get a copy of this message | ||
Hi Richard,
Thanks a lot for your prompt reply!! I get a parse-error, however, on line
77 (marked below):
function search_the_array($array) {
global $search_tmp;
$result = array_search($search_tmp, $array, TRUE);
reset($array);
Line77: while (!($result === FALSE) && (list($k, $v) = each($array)) {
// Or maybe you wanted ereg($search_tmp, $v) here...
$result = ereg($v, $search_tmp) ? $k : FALSE;
}
return ' '.$result; // extra space needed before the "key"
}
Any idea as to how this could be solved?
TIA,
Raphael