I'm trying to parse a file name to a url string.
the file name is:
201-SALÃO DE JOGOS.jpg
I need the output be exactly this:
201-SAL%c3O%20DE%20JOGOS.jpg
I'm trying like this:
$var = 201-SALÃO DE JOGOS.jpg;
echo urlencode($var);
But instead it returns:
201-SAL%C3%83O+DE+JOGOS.jpg
This is not a valid url. I've already tried with htmlspecialchars() and htmlentities() but these do not work.
You need rawurlencode
$filename = "201-SALÃO DE JOGOS.jpg";
print rawurlencode($filename);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With