title: Check if PHP curl request has timed out
body: <p>I am trying to check if a call to API has timed out. I tried adding the extra port in the url given, example: google.com:81.</p>
  
  <p>I also tried using if (curl_errno($curl)) but this doesn't seem to be the case.</p>
  
  <p>How to achieve something like this?</p>
  
  <pre><code>if(curl timeout){
   // do something ...
  } else {
   // something else ...
  }
  </code></pre>
  
  <p>Any help is appreciated!</p>