
PHP: Preg Match
Latitude & Longitude:
| Code: |
//Your Code Here
if (preg_match("/(^[1-9]{1}[0-9]{0,2}[.][0-9]{1,8}),/", $coordinates, $result1) && preg_match("/,(-{0,1}[1-9]{1}[0-9]{0,2}[.][0-9]{1,8})/", $coordinates, $result2)) { $lat = $result1[1]; $lng1 = $result2[1]; if(strstr($lng1, ",")) { $lng = str_replace(",", "", $lng1); } else { $lng = $lng1; } } //Your Code Here |





