title: php file_get_contents return bool(false) ? on geoplugin.net/json
body: <p>I have got this code to get the Code to get the Geolocation:</p>
  
  <p>Please note this is most probably the first time am seeing that error. I cant tell wherether the Geo Services are offline or what's really going on. </p>
  
  <pre><code>try{
  $json = @file_get_contents('http://www.geoplugin.net/json.gp?ip='.getIp());
  
  
  if($json === false){
  
      throw new Exception('You are not connected to the internet');
  
  
  }else{
  echo 'Great';
  }
  }catch( Exception $e){
  
  }
  
  function getIp(){
  
  $ip = "";
  
      if (!empty($_SERVER["HTTP_CLIENT_IP"]))
  {
  //check for ip from share internet
  $ip = $_SERVER["HTTP_CLIENT_IP"];
  }
  elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
  {
  // Check for the Proxy User
  $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
  }
  else
  {
  $ip = $_SERVER["REMOTE_ADDR"];
  }
  
  var_dump($ip);
  // This will print user's real IP Address
  // does't matter if user using proxy or not.
  return $ip;
      }
  </code></pre>
  
  <p>It keeps on throwing the <code>'You are not connected to the internet';</code></p>
  
  <p>What could be the issue??</p>
  
  <p>Thank you!!</p>