I want to sort my initial array(s) that contain many keys and values inside, into array(s) sorted by a specific key, and all the values for that key in a single array based on the key.
So here's the array I have:
$Before = Array(Array("id" => 1, "name" => "Dogs"),
Array("id" => 2, "name" => "Lions"),
Array("id" => 3, "name" => "Tigers"));
And this is the array that I would like to end up with:
$After = Array("ids" => Array(1, 2, 3),
"names" => Array("Dogs", "Lions", "Tigers"));
I hope that makes sense. I found it easier to show you an example, as oppose to describing it.