Jump to content

Sort an array?


Perad

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.