Re: retrieve data from multidimensional array

From: Date: Sun, 21 Jul 2002 05:07:53 +0000
Subject: Re: retrieve data from multidimensional array
Groups: php.general 
Request: Send a blank email to php-general+get-108697@lists.php.net to get a copy of this message
> >I have a multidimensional array. How can I search and retrieve all data >that is like $value from it. >the array looks like this $multi=array($row_0,$row_1); I want to >retrieve all data where $value matches $row_1 and display the data on >the screen. I know that array_search and in_array will tell me that >the data exist but I what to retrieve it. It's hard to tell from what you've said, but you might be able to use http://php.net/array_flip <?php $flipped = array_fliep($multi); echo $flipped[$value]; ?> I'm not quite sure, though, what you have in $value, $row_0, or $row_1, or what you consider a "match" nor what data you want to display on the screen... -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#108697) next »