We have an url like http://site.s3.amazonaws.com/images/some image @name.jpg
inside $string
What I\'m trying to do (yes, there is a whitesp
Using function urlencode()
for entire URL, will generate an invalid URL. Leaving the URL as it is also is not correct, because in contrast to the browsers, the file_get_contents()
function don't perform URL normalization. In your example, you need to replace spaces with %20
:
$string = str_replace(' ', '%20', $string);