Re: array sort question
| From: | Jasper Howard | Date: | Sat, 02 Oct 2004 10:42:37 +0000 |
| Subject: | Re: array sort question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198484@lists.php.net to get a copy of this message | ||
On Fri, 1 Oct 2004 22:44:50 -0400, Paul Bissex <paul.bissex@gmail.com> wrote:
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
<<--------------------------------------------------------
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
------------------------------------------------------->>