PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Thu Jul 28, 2005 5:06 am
example
Code: Select all
Array
(
ї1] => Array
(
їid] => 1
їname] => John
)
ї2] => Array
(
їid] => 2
їname] => Roger
)
ї3] => Array
(
їid] => 3
їname] => Adam
)
)
short & sweet
how would you resort the array by name?
onion2k
Jedi Mod
Posts: 5263 Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com
Post
by onion2k » Thu Jul 28, 2005 5:29 am
usort()
You'll need to write a custom function to compare the elements. The PHP manual page on it is pretty easy to follow.