<h1>hello this is phtml file</h1>
<?php $address=$_GET['location'];//manhattan
$address = str_replace(" ", "+", $address);
$url="https://maps.google.com/maps/api/geocode/json?address=$address&key=".$block->getApiKey();
echo $url;
from above code i am getting this url
if hit that url in browsers other tab it will display json data i.e https://maps.google.com/maps/api/geocode/json?address=Manhattan&key=AIzaSyBr3mn7y42_iHMTcE_5zEJk_uSGCFXIFGk
i have to fetch that data in php variables mainly longitude and latitude for setting in my map any suggestion
any help will be appreciated thanks