title: RegEx for matching latitude and longitude function
body: <p>I have a latitude and longitude data on my file, which I am trying to call by a <a href="https://ideone.com/h2xwAc" rel="nofollow noreferrer">convertor function</a>.</p>
  <p>I am trying to add function for the <code>$result60</code> line and it does not work. I am trying to pass values for the function, so it would calculate the correct latitude and longitude degrees using DM method.</p>
  <h3>Attempt</h3>
  <pre><code>$re60 = '/([EW])([0-9][0-9][0-9])([0-9][0-9])/s';
  $str60 = 'E16130';
  //$subst60 = '\\3\\2\\1';
  $subst60 = DMS2Decimal($degr = \\2, $mins = \\3, $secs = 0, $dir = \\1);
  $result60 = preg_replace($re60, $subst60, $str60);
  echo &quot;The result of the substitution is &quot;.$result60;
  </code></pre>
  <p>How do I solve this problem?</p>