mercredi 4 janvier 2017

sort array by object attributes

I want to sort a array containing objects as follows:

$object = new object();
$object->time = "10:30";
$object2 = new object();
$object2->time = "9:30";
$array = array($object, $object2);

What is the most efficient way to organize the array so that the first object is the earliest time??

Thanks for help.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2hSwDS4
via IFTTT

Aucun commentaire:

Enregistrer un commentaire