How can I sort this array by the value of the "num_of_offers" key? Currently i am getting array like this:
Array ( [0] => stdClass Object (
[ID] => 1
[post_title] => abc
[num_of_offers] => 0
[offer_amt] => 12
)
[1] => stdClass Object (
[ID] => 2
[post_title] => xyz
[num_of_offers] => 1
[offer_amt] => 12
)
[2] => stdClass Object (
[ID] => 3
[post_title] => wxy
[num_of_offers] => 2
[offer_amt] => 17
)
[3] => stdClass Object (
[ID] => 4
[post_title] => wxy
[num_of_offers] => 2
[offer_amt] => 44
)
)
But i want array like this:
Array ( [0] => stdClass Object (
[ID] => 5
[post_title] => wxy
[num_of_offers] => 2
[offer_amt] => 44
)
[1] => stdClass Object (
[ID] => 3
[post_title] => wxy
[num_of_offers] => 2
[offer_amt] => 17
)
[2] => stdClass Object (
[ID] => 2
[post_title] => xyz
[num_of_offers] => 1
[offer_amt] => 12
)
[3] => stdClass Object (
[ID] => 1
[post_title] => abc
[num_of_offers] => 0
[offer_amt] => 12
)
)