Posted By

Rain on 10/29/11


php sort object array

Versions (?)

Sort array of objects by object's property

 / Published in: PHP

Used to sort array of objects by it's property

Note: Anonymous functions are available since PHP 5.3.0.

  1. uasort($objects, function($a, $b) { return strcmp($a->property, $b->property); } );

Report this snippet  

You need to login to post a comment.