title: CURLOPT_TIMEOUT , is there "else" function?
body: <pre><code>    &lt;?php
  function get_random_proxy()
  {
      srand ((double)microtime()*1000000);
      $f_contents = file ("proxy.txt");
      $line = $f_contents[array_rand ($f_contents)];
      return $line;
  }
  $proxy = get_random_proxy(); 
              $ch = curl_init(); 
              curl_setopt($ch, CURLOPT_URL, "example.com");
              curl_setopt($ch, CURLOPT_PROXY,$proxy); 
              curl_setopt($ch, CURLOPT_TIMEOUT ,30);
              curl_exec($ch);  
              curl_close($ch);      
      ?&gt;
  </code></pre>
  
  <p>curl will close connection if can not connect within the 30 seconds. </p>
  
  <p>as you can see, i'm using proxy list. however, some proxy ips sometimes have problems to connect within the 30 seconds, and curl is closing connection when can not load in 30 seconds. </p>
  
  <p>i wanna try another ip for curl connect if curl timeout reached. right now, curl is closing everything if ip isn't working. i wanna try another ip. well, could you please suggest me a function?</p>
  
  <p>edited for @rubayeet. added new proxy function</p>