I have an array:
[photos] => Array
(
[0] => stdClass Object
(
[id] => 14
[name] => image1.jpg
)
[1] => stdClass Object
(
[id] => 24
[name] => image2.gif
)
)
And I would like to move element with ID =24 to the top (to be first) in array.
For example:
function mysort(24) {
...
}
And get as output:
[photos] => Array
(
[1] => stdClass Object
(
[id] => 24
[name] => image2.gif
)
[0] => stdClass Object
(
[id] => 14
[name] => image1.jpg
)
)