title: CURL request at No Internet in PHP
body: <p>I am working with CURL request in PHP. My code is like below.</p>
  <pre><code>        // init curl object
          $ch = curl_init();
  
          // define options
          $option_array = array(
              CURLOPT_URL =&gt; $api_url,
              CURLOPT_RETURNTRANSFER =&gt; 1,
              CURLOPT_HEADER =&gt; 0,
              CURLOPT_FOLLOWLOCATION =&gt; 1,
              CURLOPT_VERBOSE =&gt; 0,
              CURLOPT_SSL_VERIFYPEER =&gt; 0,
              CURLOPT_FAILONERROR =&gt; 1
          );
          
          // apply options
          curl_setopt_array($ch, $option_array);
  
          // execute request and get response
          $response = curl_exec($ch);
          
          if(curl_errno($ch)){
              echo 'error:' . curl_error($ch);
          } else {
              return $response;        
          }
  
          curl_close($ch);
  </code></pre>
  <p>How to know internet is not available at CURL request in PHP ?</p>