I have the following array. I need to sort this array by the nested array key [id]:
Array (
[0] => Array ( [id] => 5 [category_id] => 12 )
[1] => Array ( [id] => 3 [category_id] => 12 )
[2] => Array ( [id] => 9 [category_id] => 12 )
[3] => Array ( [id] => 4 [category_id] => 12 )
)
you can do it like this
in case you want to get the same array sorted then you can add the following code: