This should be ludicrously easy, but I can't seem to find a function to do this. Lets say I have an array:
(
"blah1" => "poo1",
"blah2" => "poo2",
"blah3" => "poo3"
"blah4" => "poo4"
);
i want to move a given key=>value pair up one slot like so:
(
"blah1" => "poo1",
"blah2" => "poo2",
"blah4" => "poo4"
"blah3" => "poo3"
);
This would be trivial with plain numeric indexes, but with keys it seems rather difficult. I wrote a very complex algorithm to achieve this effect, but it isn't practical and I'd like to know if there is an easier way to do this.
Thanks!