This question already has an answer here:
- sorting arrays by months [duplicate] 6 answers
I have an object array
<pre>stdClass Object
(
[October] => 13.88888888888889
[January] => 11.11111111111111
[April] => 17.77777777777778
[February] => 12.777777777777777
[August] => 17.77777777777778
[June] => 16.11111111111111
[May] => 16.11111111111111
[July] => 17.77777777777778
[November] => 12.222222222222221
[March] => 12.777777777777777
[December] => 11.11111111111111
[September] => 15.0
)
</pre>
I want to sort this array on the basis of month (key)
I used ksort() function but error coming that it must be array not object.
Then I converted it to array as array($data); and then used ksort() again but still no result.
Please help my guys how to do??
json_encode($std)
,$std = json_decode($std, true)
– Mihai Iorga Apr 26 at 6:06