I'm using data from a JSON file and PHP, which includes a 'location' array that contains lat and long values.
I echoed the values out like this :
foreach ($row['location'] as $result) {
echo 'Latitude:', '<br>', $result['lat'], '<br>';
echo 'Longtitude:', '<br>', $result['long'];
}
I'm trying to make it so that there is a Google Map on the page showing the location that you can click and will take you to the maps page.
<iframe
width="300"
height="170"
frameborder="0"
scrolling="no"
marginheight="0"
marginwidth="0"
src="https://maps.google.com/maps?q= <?php echo $result['lat'] , $result['long']?> &hl=en-GB&z=14&output=embed"
>
This opens Google Maps and everything, but does not put a comma between the two values, so Maps says it's not a correct location. I can't figure out how to add the comma so that it works fine. Hope that I explained this well enough, any help would be fab, thanks.