I've got an multi-dimensional array at the moment and want to remove the second-level of arrays and have the value of that second level as the new index value on the parent array. My current array is:
Array ( [0] => Array ( [connectee] => 1 ) [1] => Array ( [connectee] => 6 ) )
And want from that:
Array ( [0] => 1, [1] => 6 )
I was poking around the usort function but couldn't get it to work (where $current_connections is my array as above:
function cmp($a, $b) {
return strcmp($a["connectee"], $b["connectee"]);
}
$current_connections = usort($current_connections, "cmp");
The key doesn't need to be maintained (should be destroyed in the process).