From: Richard L. <ce...@l-...> - 2008-12-03 03:32:52
|
Just catching up on email and... First off, it really should be in a database that you search and sort. Using PHP to do that is almost always a sign of a bad architectural decision... You might even toss the data into sqlite just to have sane way to search/sort it. That said, if the array is "small" iterating through is fine But if the array is big, you could probably use some kind of http://php.net/usort on the array and then a binary search on the time frame in question to find the answer quicker than an iteration. On Fri, November 14, 2008 12:18 pm, Steve Gadlin wrote: > Hey there, PHP-folks! > > I have an array question, and I was hoping someone here could point me > in > the right direction. > > So I¹ve got this array, see... > > $arToday[0][³title²] = ³Patty Duke² > $arToday[0][³starttime²] = 12:00:00 > $arToday[1][³title²] = ³Sesame Street² > $arToday[1][³starttime²] = 12:30:00 > ... > ... > Etc. > > Is there an easy way for me to ³query² this array to snag the index of > the > record whose starttime variable is current? Thereby selecting the > name of > the program that may be airing ³now²? > > Thanks so much for your help! If there¹s some other list I should be > posting questions to instead of this one, let me know. > > Steve > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > -- Some people ask for gifts here. I just want you to buy an Indie CD for yourself: http://cdbaby.com/search/from/lynch |