Convert google map url to coordinates <p>I want to convert this google map url "http//maps.google.com/maps?f=q&amp;q=14.674518%2C120.549043&amp;z=16" to just value of latitude and longitude.</p> <p>Here's my code:</p> <pre><code>$string='http://maps.google.com/maps?f=q&amp;q=14.674518%2C120.549043&amp;z=16'; $regex=' , http://maps\.google\.com/maps\?q=\K[^&amp;]+,'; preg_match($regex,$string,$m); echo $m[0].'&lt;br /&gt;'; </code></pre> <p>Thanks!</p>