4

I got an string like:

M%C3%B2nica

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

Which is the best way in PHP?

Bernat
  • 1,537
  • 3
  • 18
  • 40

2 Answers2

9
echo rawurldecode ('M%C3%B2nica'); // prints Mónica

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

Community
  • 1
  • 1
Jeroen
  • 13,056
  • 4
  • 42
  • 63
1

Shortest answer : urldecode();

ilanco
  • 9,581
  • 4
  • 32
  • 37