I have the following array:
$foo = ["hello", "hi", [5, 10]];
I want to convert this to an associative array like so:
$foo = [
"0" => "hello",
"1" => "hi",
"2" => [5, 10],
];
How can I do this?
UPDATE
The reason I want to do this is because when I execute the shuffle method, I want to know what the original index was.
For example shuffle($foo) might return:
$foo = [
"1" => "hi",
"2" => [5, 10],
"0" => "hello",
];