How do I order an array by key, this is example:
array(3){
[3] => array(),
[2] => array(),
[1] => array()
}
What I need is:
array(3){
[1] => array(),
[2] => array(),
[3] => array()
}
How do I order an array by key, this is example:
array(3){
[3] => array(),
[2] => array(),
[1] => array()
}
What I need is:
array(3){
[1] => array(),
[2] => array(),
[3] => array()
}
Sorts an array by key, maintaining key to data correlations. This is useful mainly for associative arrays.
Your what I need doesn't make sense, do you really want to kick out [3] ?
Other than that, to answer your actual question, to sort arrays by key, just use phps ksort