PHP: imagecreatefromjpeg($url) doesn't work if $url contains spaces?
<p>I use a script to get an image from another server and store it in the db, the problem is that when the url has a space in it, the function grabs nothing.</p>

<p>I tried to encode the url and  to simply replace all spaces with %20 but with no success.</p>

<p>I'm running out of options, if any of you could give me some ideas would be great!</p>

<p>Thanks!</p>

<pre><code>$thumb=imagecreatefromjpeg(http://www.dummysite.ca/imageone.jpg); //-&gt;WORKS
$thumb=imagecreatefromjpeg(http://www.dummysite.ca/image one.jpg); //-&gt;DOESN'T WORK
</code></pre>

<p>EDIT: more info: I'm running a CentOS machine, php 5.2.17</p>

<p><strong>EDIT: found the answer, replacing spaces with %20 actually WORKS but I was foolish and only replace it before the <code>imagecreatefromjpeg</code> call, it turns out <code>getimagesize</code> needs it as well</strong></p>
