Afficher un message
Vieux 16/01/2008, 23h44   #2
elmosik@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Better multidimensional search

On 16 Sty, 23:32, "Guillaume Dargaud" <USE_MY_WEB_F...@gdargaud.net>
wrote:
> I'm pretty sure there's a better way to do this without having to explore
> the whole array until a match is found, but the solution escapes me at the
> moment:
>
> foreach ($Array as $key)
> if ($key[1]===$Whatever) {
> $Found=$key[0];
> break;
> }


If you're looking for key instead of item you should write:

foreach( $array as $key => $item )...

looking for item? use array_search.
  Réponse avec citation
 
Page generated in 0,06182 seconds with 9 queries