Re: sorting object props

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux