I've a rather large array that looks like
Array(
[0] => stdClass Object
(
[id] => 8585320
[title] => the title
[type] => page
[url] => link.com
[excerpt] => brief description
)
[1] => stdClass Object
(
[id] => 8585320
[title] => the title
[type] => page
[url] => link.com
[excerpt] => brief description
)
)
I have no apparent control over the way the array is formed, and how it comes out, it seems as there is little if any logic to it. But I am stuck with it. So what I need to do is basically take the array sort it numerically by each stdClass Object and then make sure the id's are from largest to smallest and not smallest to largest. All the while maintaining the current structure of the array object combination
I can't even begin to think right now how I would need to approach sorting it the way I need it. As its already been a long enough day.
UPDATE
public function updateRet($a, $b) {
return $b->id - $a->id;
}
usort($ret, 'updateRet');