You are here: Re: Better multidimensional search « PHP Programming Language « IT news, forums, messages
Re: Better multidimensional search

Posted by elmosik on 09/27/55 12:00

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация