title: trouble with php getimagesize (url encode problems with space)
body: <p>I use <code>getimagesize</code> to judge an image height and size. </p>
  
  <p>When a url has space, the <code>getimagesize</code> echo's an error. I've tried using <code>urlencode()</code> to transfer all the url address, it still returns an error. I noticed that if I just change the space into <code>%20</code>, <code>getimagesize</code> runs ok. </p>
  
  <p>I have no idea why?</p>
  
  <p>I also tired to  use <code>$newurl = preg_replace(' ', '%20', $url);</code> It echo'ed :</p>
  
  <pre><code>Warning: preg_replace() [function.preg-replace]: Empty regular expression
  </code></pre>
  
  <p>So how to <em><code>preg_replace</code></em> correctly. And is there a way to transfer the url correctly with <code>getimagesize</code> so that it passes all possible test cases.</p>
  
  <p>Thanks</p>