As you can see on the title, I am trying to fopen()
a Url with whitespaces. Other stackoverflow posts didn't help really, could it possibly be that they are outdated?
I have tried:
- urlencode
- rawurlencode
None of the above works , http://test.com/two - words.jpg
this gives me:
- urlencode:
http%3A%2F%2Ftest.com%2Ftwo+-+words.jpg
- rawurlencode:
http%3A%2F%2Ftest.com%2Ftwo%20-%20words.jpg
When i am trying to clearly get http://test.com/two%20-%20words.jpg
, which is what the browser shows when you type http://test.com/two - words.jpg
and hit enter.
Which function do I have to use to make those conversions from space
to %20
, and all
the other possible conversions i could need(which i can't think of any more, but i am pretty sure they exist, maybe on special symbols) ?