Perad Posted March 20, 2008 Share Posted March 20, 2008 Take this array. $content[] = array('online' => $res['online'], 'username' => $res['username'], 'photo' => $res['photo_thumb']); I need to sort the users to decide whether they are online or not. Online is either 'on' or 'off'. I have had a look at the php documentation but have promptly got lost. How can I sort the array so that results with 'online' => 'on' will be at the beginning of the array? Link to comment https://forums.phpfreaks.com/topic/97067-sort-an-array/ Share on other sites More sharing options...
Cep Posted March 20, 2008 Share Posted March 20, 2008 http://www.php.net/manual/en/function.uasort.php Link to comment https://forums.phpfreaks.com/topic/97067-sort-an-array/#findComment-496687 Share on other sites More sharing options...
Perad Posted March 20, 2008 Author Share Posted March 20, 2008 I had a look at that at that page and the usort page. I don't understand it. Link to comment https://forums.phpfreaks.com/topic/97067-sort-an-array/#findComment-496698 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.