We have a url like http://site.s3.amazonaws.com/images/some image @name.jpg inside $string
What I'm trying to do (yes, there is a space around the url):
$string = urlencode(trim($string)); $string_data = file_get_contents($string);
What I get (@ also replaced):
file_get_contents(http%3A%2F%2Fsite.s3.amazonaws.com%2Fimages% 2Fsome+image+@name.jpg )[function.file-get-contents]: failed to open stream: No such file or directory
If you copy / paste http://site.s3.amazonaws.com/images/some image @name.jpg into the address bar of your browser, an image will open.
What is bad and how to fix it?
James
source share