You are here: Re: Sorting an Array « PHP Programming Language « IT news, forums, messages
Re: Sorting an Array

Posted by ZeldorBlat on 10/07/00 12:00

On Jan 16, 11:48 am, dunctait <dunct...@hotmail.com> wrote:
> hi there,
>
> im going to loop through 17thousand mysql entries (each entry has
> aunique, and incremental, id) then calculate a rating of each entry
> based on some other information. (between 1 and 5)
>
> i then want to sort the data with the highest rated entries at the top
> of the list?
>
> my first plan was to add each calculation into an array, as the array
> number would match the unique id, then at the end use the sort
> function, but then i would lose the unique id information by doing
> this.
>
> is there some way to use sort on an array of array[id][rating]? or an
> array of objects somehow?
>
> thanks for any help,
> duncan

How about asort() ?

<http://us.php.net/asort>

 

Navigation:

[Reply to this 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

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