Re: Re: "searching" arrays

From: Date: Wed, 15 Aug 2001 07:58:10 +0000
Subject: Re: Re: "searching" arrays
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-62788@lists.php.net to get a copy of this message
On Wed, 15 Aug 2001 16:17, Raphael Pirker wrote: > 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 A quick count seems to show a different number of left and right parentheses in that line. Match your brackets and you should be OK. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA "I only have diamonds, clubs and spades," said Tom heartlessly.

« previous php.general (#62788) next »