You are here: Re: [PHP] sorting object props « PHP « IT news, forums, messages
Re: [PHP] sorting object props

Posted by "Richard Lynch" on 06/18/05 23:54

On Fri, June 17, 2005 2:48 pm, D_C said:
> is there a way to sort the properties of an object by their name, much
> like sort works on arrays?
>
> i am getting back an object from a database query and want to list the
> resulting items in alpha order by field name...

http://php.net/ksort

Last time I checked, PHP would still convert an object to an array if you
forced it to...

If not, there are introspective functions to examine your object and all
its properties, and surely you could build the array yourself and then
ksort it.

--
Like Music?
http://l-i-e.com/artists.htm

 

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

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