fork(4) download
  1. <?php
  2.  
  3. // your code goes here
  4. $arr = array();
  5. $result = preg_match('/^([NSWE])(\d\d?).(\d\d?).(\d\d?(?:[.,]\d+)?).$/u', "W8°25′52.134″", $arr);
  6. var_dump($result);
  7. print_r($arr);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
int(1)
Array
(
    [0] => W8°25′52.134″
    [1] => W
    [2] => 8
    [3] => 25
    [4] => 52.134
)