I have a few strings in the following format:
S25 22.087 E152 46.125
S23 32.230 E148 10.576
S25 00.039 E152 12.480
S26 19.496 E152 43.501
I would like to parse the strings and split them into two parts, so: $foo = 'S25 22.087 E152 46.125';
would become:
$foo[0] = 'S25 22.087';
$foo[1] = 'E152 46.125';
(it doesn't have to be in an array, two new variables would also work fine).
How can this be done? I'd prefer to have a regexp use rather than finding the posing of E and doing a substr()
.