try to add to your script:
function cmp ($a, $b) {
return strcmp($a["3"],$b["3"]);
}
usort($data, "cmp");
"Fifield, Mike" <[EMAIL PROTECTED]> wrote: What I am trying to do is sort a
array of arrays but I want to sort by one
of the pieces of data stored in the arrays inside the array. For
On Thu, 2002-02-14 at 08:26, Fifield, Mike wrote:
> What I am trying to do is sort a array of arrays but I want to sort by one
> of the pieces of data stored in the arrays inside the array. For example;
> $data[blue] = array("name", "age", "time", "3");
> $data[green] = array("name", "age", "time"
D]
Subject: RE: [PHP] Sorting an array of arrays
Good day,
uasort() should do what you need.
http://www.php.net/manual/en/function.uasort.php
There's an example for the usort function that does something similar to
what you want, in fact.
Darren Gamble
Pl
- 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948
-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 9:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Sorting an array of arrays
What I am trying to do is sort a array of arrays
What I am trying to do is sort a array of arrays but I want to sort by one
of the pieces of data stored in the arrays inside the array. For example;
$data[blue] = array("name", "age", "time", "3");
$data[green] = array("name", "age", "time", "7");
$data[red] = array("name", "age", "time", "6");
$d
5 matches
Mail list logo