I need to change where one item is ordered in an array. I know how to sory an array, but I need to move one item up/down in the array. Example:
$array is:
0 => "element one"
1 => "element two"
2 => "element three"
3 => "element four"
I call array_order_up($array[1]) and $array is now:
0 => "element one"
2 => "element three"
1 => "element two"
3 => "element four"

If there aren't any native functions to do this, can anyone think of a way to make my own function to do this?

--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to