title: php isImage($url) using stream_get_meta_data doesn't work with local file path
body: <p>is it possible to adapt this function so it also works with local file path's?</p>
  
  <p>$meta contains the following:
  Array ( [wrapper_type] => plainfile [stream_type] => STDIO [mode] => rb [unread_bytes] => 0 [seekable] => 1 [uri] => C:\imgs\232434.jpg [timed_out] => [blocked] => 1 [eof] => ) </p>
  
  <p>$meta["wrapper_data"] doesn't exist.</p>
  
  <pre><code>function isImage($url)
    {
       $params = array('http' =&gt; array(
                    'method' =&gt; 'HEAD'
                 ));
       $ctx = stream_context_create($params);
       $fp = @fopen($url, 'rb', false, $ctx);
       if (!$fp) 
          return false;  // Problem with url
  
      $meta = stream_get_meta_data($fp);
      if ($meta === false)
      {
          fclose($fp);
          return false;  // Problem reading data from url
      }
  
      $wrapper_data = $meta["wrapper_data"];
      if(is_array($wrapper_data)){
        foreach(array_keys($wrapper_data) as $hh){
            if (substr($wrapper_data[$hh], 0, 19) == "Content-Type: image") // strlen("Content-Type: image") == 19 
            {
              fclose($fp);
              return true;
            }
        }
      }
  
      fclose($fp);
      return false;
    }
  </code></pre>