I have a string like 1-350,9-390.99,..., and I need to turn it into an associative array like this:
Array
(
[1] => 350
[9] => 390.99
...........
)
Is it possible to do this using only array functions, without a loop?
Here’s a way to do it without a for loop, using array_walk:
Example on Ideone.com.