So I have this problem, I am extracting a string from excel that has this structure:
89.356 87.54, 45.34 98.254, 45.2413 45.2146, 98.23 35.647
And I want to build an array with the following structure:
Array
(
[0] => Array
(
['first'] => 89.356
['second'] => 87.54
)
[1] => Array
(
['first'] => 45.34
['second'] => 98.254
)
[2] => Array
(
['first'] => 45.2413
['second'] => 45.2146
)
)
I am extracting these values from an excel and creating the array like this:
$polygons = $sheet->getCell("B".$row)->getValue();
$ret = array_map (
function ($) {return explode (' ', $);},
explode (',', $polygons)
);
But I do not know how to assign the key values 'first' and 'second' to the array.