I have a string like this -
[ [ -2, 0.5 ],
I want to retrieve the numeric characters and put them into an array that will end up looking like this:
array(
[0] => -2,
[1] => 0.5
)
What is the best way of doing this?
Edit:
An more thorough example
[ [ -2, 0.5, 4, 8.6 ],
[ 5, 0.5, 1, -6.2 ],
[ -2, 3.5, 4, 8.6 ],
[ -2, 0.5, -3, 8.6 ] ]
I am going through this matrix line by line and I want to extract the numbers into an array for each line.