I could not find something about this, probably I missed it, but I want to filter/sort an array which has an key which I want to move to the top, so it will be the first item. In my example I want the key 3 to move to the top. Is there a simple way to do this?
// at default
[
"key 1" : [ more data ],
"key 2" : [ even more data ],
"key 3" : [ some data ],// for this example I want this to be the first item
"key 4" : [ where is the data ]
]
// how i want it to be
move_to_first_in_array($array , 'key 3');
[
"key 3" : [ some data ],// for this example I want this to be the first item
"key 1" : [ more data ],
"key 2" : [ even more data ],
"key 4" : [ where is the data ]
]