<?php $string = "MULTILINESTRING ((-77.083060324719384 42.15108721847372, -77.087448024528669 42.151768518696542"; $pattern = '/((-?\d+\.\d+)\s(-?\d+\.\d+))/'; $arr = preg_match_all($pattern,$string,$matches); print_r($matches); $len = count($matches[0]); $coordinates = []; for($i=0;$i<$len;++$i){ $coordinates[] = [ $matches[2][$i], $matches[3][$i] ]; } print_r($coordinates);
You have javascript disabled. You will not be able to edit any code.