Re: re-ordering keys in an array
| From: | David T-G | Date: | Tue, 21 Jan 2003 14:32:43 +0000 |
| Subject: | Re: re-ordering keys in an array | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132406@lists.php.net to get a copy of this message | ||
Jason, et al --
..and then Jason k Larson said...
%
% There are many pre-defined functions to manipulate the sort order of
% arrays and it's keys. However sometimes, to fit special needs, you just
% have to do it manually. Here's the useful PHP reference manual links to
% better understand what's available.
%
% http://www.php.net/manual/en/ref.array.php
%
% http://www.php.net/manual/en/function.asort.php
% http://www.php.net/manual/en/function.arsort.php
%
% http://www.php.net/manual/en/function.ksort.php
% http://www.php.net/manual/en/function.krsort.php
%
% http://www.php.net/manual/en/function.usort.php
% http://www.php.net/manual/en/function.uksort.php
Thanks for the pointers. All of those are great (I hadn't read up on
asort yet; quite nice, and I may offer a "sort these pictures by name"
option based on that or a nat sort) but don't help me with the problem of
reordering keys based on a position, and I don't think I want to try
writing the sort function that will take arbitrary input and spit it back
out with the purpose of moving a single key around :-)
%
%
% HTH,
% Jason k Larson
Thanks & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!