title: how to get json in url https
body: <p>I want to get timeZoneId using googleapis url. I want this url return me json response to parse it later and insert lat and long in my database. It works fine when it's not a googlemap url but i have the famous "request_denied" error when I use this kind of url in my code:</p>
  
  <p>How to get json in url from google, I want to get timezone from latitude, longitude, and timestamp</p>
  
  <p><a href="https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&amp;timestamp=1331766000&amp;sensor=false" rel="nofollow noreferrer">https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&amp;timestamp=1331766000&amp;sensor=false</a></p>
  
  <p>I have tried get data from URL with file_get_contents. </p>
  
  <pre><code>$json_url = 'https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&amp;timestamp=1331766000&amp;sensor=false';
  $json = file_get_contents($json_url);
  $obj = json_decode($json);
  echo $obj-&gt;timeZoneId;
  </code></pre>
  
  <p>But it doesn't work. It alwy return <strong>"status" : "REQUEST_DENIED"</strong> 
  Thanks any got a tip. </p>
  
  <p><strong>Update</strong> </p>
  
  <blockquote>
    <p>thank for all :) i checked in php <strong>extention-> php_openssl</strong> and it
    work</p>
  </blockquote>