Reply to Re: Partial Sort ?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация