You are here: Re: Make selection in array « PHP Programming Language « IT news, forums, messages
Re: Make selection in array

Posted by frizzle on 01/10/06 00:31

Marcin Dobrucki wrote:
> Even in the first case, you will need to loop through the array to
> pick up the "rows" where age=22 (I assume the 'name' was a typo). The
> question also is what is a big loop? 100 iterations? 10000000 iterations?
>
> /m
>
> frizzle wrote:
> > Hi there.
> > I have this array:
> >
> > name => john, age => 45, profession => teacher
> > name => hank, age => 22, profession => student
> > name => mary, age => 36, profession => dancer
> > etc.
> > etc.
> >
> > It's going to be a big array.
> >
> > Now what i wonder, how can i do the following;
> > while( $array['name'] == 22 )
> > {
> >
> > do something.
> >
> > }
> >
> > I want to prevent the following:
> > while( $array )
> > {
> >
> > if( 'name' == 22 ){
> >
> > do something
> >
> > }
> >
> > }
> >
> > Because this would create a big loop everytime.
> >
> > Greetings Frizzle.
> >

'Name' was a sloppy typo indeed :$, the array is going to be ca. 150
iterations, but with big chunks of text in them....

Frizzle.

 

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

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