title: Warning: strpos() expects parameter 1 to be string, array given in
body: <p>I don't know what happen <code>eror_log</code> generate, but code works fine, but log is make me curious</p>
  
  <blockquote>
    <p>PHP Warning:  strpos() expects parameter 1 to be string, array given in /home/abc/public_html/url.php on line 46</p>
  </blockquote>
  
  <p>the line 46 is:</p>
  
  <blockquote>
    <p><code>if (strpos($headers['Content-Type'], 'image/') === FALSE) {</code></p>
  </blockquote>
  
  <p>Here's the code:</p>
  
  <pre><code>$headers = @get_headers($url, 1); // @ to suppress errors. Remove when debugging.
  if (isset($headers['Content-Type'])) {
    if (strpos($headers['Content-Type'], 'image/') === FALSE) {
      // Not a regular image (including a 404).
    }
    else {
      // It's an image!
      header("Location: ".$url);
      die();
    }
  }
  else {
    // No 'Content-Type' returned.
  }
  </code></pre>