![]() |
|
#1
|
||||
|
||||
Array_search on a multidimensional arrayI am trying to search a multidimensional array but so far I cannot get this done through array_search() easily.
Any ideas? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
||||
|
#2
|
|||
|
|||
|
Why don't you make a loop that will run from 0 to the length of the array and then use that as the first dimension and search the second dimension from there. Just a thought,
Nick |
|
#3
|
||||
|
||||
|
Yes, I am beginning to think that that's the only way...
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#4
|
||||
|
||||
How to search a multidimensional array?It took me a while but I got it eventually...
The trick is to use array_filter() instead! Works wonderfully on a few scripts that I have tried it on. I finally got around to writing a tutorial on it even: http://www.desilva.biz/arrays/filter.html __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ Last edited by admin : 04-Apr-2004 at 11:36.
|
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sorting a 2D array c++ | mike3340 | C++ Forum | 4 | 15-Dec-2003 14:35 |
| Extra null element in an array | samtediou | MySQL / PHP Forum | 2 | 11-Dec-2003 12:52 |
| deleting from an array | ionyka | C++ Forum | 1 | 02-Sep-2003 04:09 |
| Problem with array | norok | MySQL / PHP Forum | 3 | 16-Jul-2003 03:08 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The