Re: array sort question
| From: | Paul Bissex | Date: | Sat, 02 Oct 2004 02:44:50 +0000 |
| Subject: | Re: array sort question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198476@lists.php.net to get a copy of this message | ||
On Fri, 1 Oct 2004 19:12:30 -0700, Ed Lazor <ed.lazor@d20news.com> wrote:
> Any ideas on how I could sort this array by Title?
>
> $menu[1]["ID"] = 5;
>
> $menu[1]["Title"] = "Test 1";
>
> $menu[2]["ID"] = 3;
>
> $menu[2]["Title"] = "Test 4";
uasort() is what you need here.
Also see the usort() documentation page for an example of how to write
the comparison callback function that you pass to uasort().
pb
--
paul bissex, e-scribe.com -- database-driven web development
413.585.8095
69.55.225.29
01061-0847
72°39'71"W 42°19'42"N