Percentage encoded process with special characters in PHP

I got a line like:

M% C3% B2nica

So I need to get something like "Mònica".

What is the best way in PHP?

+3
source share
2 answers
echo rawurldecode ('M%C3%B2nica'); // prints Mónica

You can use urldecode () or rawurldecode (), but in your case it probably doesn't matter. (more on this here: urlencode vs rawurlencode? )

+9
source

The shortest answer: urldecode();

+1
source

All Articles