Re: array_multisort?
| From: | Kevin Stone | Date: | Wed, 02 Jan 2002 19:31:04 +0000 |
| Subject: | Re: array_multisort? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79244@lists.php.net to get a copy of this message | ||
Unless your problem is more extensive than what you're explaining here,
there's no reason to do any kind of sort. Simply reorder the list yourself
so that whatever ends up in $title is reordered to the first index of your
$shop list...
$product = array ($id, $title, $price);
$shop = array ($product[1], $product[0], $product[2]);
-Kevin
----- Original Message -----
From: "Sebastiaan Timmers - Bean IT" <sebastiaan@bean-it.nl>
To: <php-general@lists.php.net>
Sent: Wednesday, January 02, 2002 6:47 AM
Subject: [PHP] array_multisort?
> Hi List,
>
> I'm having a problem sorting the following array:
>
> $product = array($id, $title, $price);
> $shop[] = $product;
>
>
> I want the array 'shop' to be sorted by the 'title' in array
> 'product'. I
> tried the function 'array_multisort()', but that did not do the trick.
>
> Does anyone know how to fix this?
>
> Best regards,
>
> Sebastiaan Timmers
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>