If I have an array with objects like this:
Array
(
    [0] => stdClass Object
        (
            [img] => image1.jpg
            [order] => 1
        )
    [1] => stdClass Object
        (
            [img] => image2.jpg
            [order] => 3
        )
    [2] => stdClass Object
        (
            [img] => image3.jpg
            [order] => 2
        )
    [3] => stdClass Object
        (
            [img] => image4.jpg
            [order] => 4
        )
)
How can I then sort the array by the objects "order" value? In this case the order should be: image1.jpg, image3.jpg, image2.jpg, image4.jpg.
 
     
     
     
    