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? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.