SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: PHP multisort problem
-
Jul 19, 2009, 10:36 #1
- Join Date
- Mar 2009
- Location
- London
- Posts
- 45
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP multisort problem [SOLVED]
Hi guys,
I have an nested multi-dimensional array like this:
Code:Array [0] Array [0]=>42[id]=>42 [1]=>Audience[groupname]=>Audience [2]=>0[is_active]=>0 [1] Array, etc, etc...
PHP Code:
array_multisort($input[groupname], SORT_ASC, SORT_STRING);
PHP Code:
array_multisort($input[1], SORT_ASC, SORT_STRING);
I want to sort by groupname: Anybody know what I'm doing wrong or how to fix it?
Any help would really be appreciated...
Thanks in advance...Last edited by jmsherry; Jul 20, 2009 at 06:34. Reason: solved
-
Jul 19, 2009, 12:58 #2
- Join Date
- Mar 2009
- Location
- London
- Posts
- 45
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
http://firsttube.com/read/sorting-a-...rray-with-php/
Has the solution...
Part 2 of my problem now is that I'm trying to array_combine with this multidimensional array and give the key values to only the first level array...
Anybody know how to do that?
-
Jul 19, 2009, 17:07 #3
- Join Date
- Mar 2009
- Location
- London
- Posts
- 45
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Sorry...had applied padding to wrong thing...server had errors suppressed...
array_combine works fine when the elements are equal...
Bookmarks