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
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
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Ave
4 matches
Mail list logo