[PHP] Sorting Multidimensional Array

2006-10-31 Thread Keith Spiller
Hi, RE: Sorting Multidimensional Array I'm trying to sort a multidimensional array. The data was taken from a mysql query: $myrow = mysql_fetch_row($result) { query[] = $myrow; } The purpose is to retrieve the table data and manually add a record, then sort ASC by the startdate which is the

Re: [PHP] Sorting Multidimensional Array

2006-10-31 Thread Keith Spiller
> To: "Keith Spiller" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, October 31, 2006 10:48 AM Subject: Re: [PHP] Sorting Multidimensional Array On Tue, October 31, 2006 11:10 am, Keith Spiller wrote: RE: Sorting Multidimensional Array I'm trying to sort a multidimensional array.

Re: [PHP] Sorting Multidimensional Array

2006-10-31 Thread Richard Lynch
On Tue, October 31, 2006 11:10 am, Keith Spiller wrote: > RE: Sorting Multidimensional Array > > I'm trying to sort a multidimensional array. The data was taken from > a mysql query: > > $myrow = mysql_fetch_row($result) { > query[] = $myrow; > } > > The purpose is to retrieve the table data an

Re: [PHP] sorting multidimensional array by a second level value

2004-09-17 Thread Matt M.
> > I'd like to sort the array based on one of the values in the field > > href, description, or time. Is there a canonical way of doing this? you might be able to use http://us2.php.net/manual/en/function.usort.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://

Re: [PHP] sorting multidimensional array by a second level value

2004-09-17 Thread Steve Brown
> I'd like to sort the array based on one of the values in the field > href, description, or time. Is there a canonical way of doing this? Probably easiest to write your own sort function the use usort(), http://www.php.net/usort has pretty good documentation on how to accomplish this. Steve --

Re: [PHP] sorting multidimensional array by a second level value

2004-09-17 Thread Jason Davidson
http://ca3.php.net/manual/en/function.array-multisort.php this might do it. Jason Chris Lott <[EMAIL PROTECTED]> wrote: > > I have an array $links like this: > > [1] => Array > ( > [href] => http://www.poetrymagazine.org/epstein_sept_prose.html > [description]

[PHP] sorting multidimensional array by a second level value

2004-09-17 Thread Chris Lott
I have an array $links like this: [1] => Array ( [href] => http://www.poetrymagazine.org/epstein_sept_prose.html [description] => Thank You, No [time] => 2004-09-17T17:30:32Z ) [2] => Array ( [href] => http://110am.com/projec

[PHP] Sorting Multidimensional Array..second dimension has 12 elements

2001-12-08 Thread J. Roberts
I have a 2 dimensional array...with the second dimension having 12 elements. What I want to do is sort (and re-sort) they array by one of the 12 elements...keeping data consistent. All of the examples I have read @php.net seem to deal with multidim-arrays that only have one element in them. H