title: Detect if cURL works?
body: <p>This is the warning.</p>
  
  <blockquote>
    <p>Warning: curl_setopt_array()
    [function.curl-setopt-array]:
    CURLOPT_FOLLOWLOCATION cannot be
    activated when in safe_mode or an
    open_basedir is set in /.../file.php
    on line 41</p>
  </blockquote>
  
  <p>This is what I am using to detect cURL. If cURL isn't enabled a work around is triggered.</p>
  
  <pre><code>function curlEnabled() {
      if (ini_get('safe_mode') == 1)
          return 0;
  
      return in_array('curl', get_loaded_extensions());
  }
  </code></pre>
  
  <p>I am finding it very difficult to test this function effectively do to a lack of hosting with safe mode enabled or cURL disabled.</p>
  
  <p>Could someone tell me.</p>
  
  <ol>
  <li>Does the function actually detect PHP safe_mode?</li>
  <li>It detects whether cURL is loaded right?</li>
  </ol>
  
  <p>Finally, how would this function be improved to catch the 'cannot be activated' error and return 0?</p>