|
Posted by petersprc on 06/20/07 10:13
On Jun 20, 3:18 am, comatose wrote:
> if I have an array of ten items how can I sort the first five items in
> the array without sorting the second five items?
$array = array('c', 'b', 'a', 'q', 's', 'r', 'h', 'p');
$head = array_slice($array, 0, 5);
sort($head);
$newArray = array_merge($head, array_splice($array, 5));
I believe someone mentioned this...
[Back to original message]
|