how can I javascript decodeURI in PHP?

前端 未结 3 710
慢半拍i
慢半拍i 2021-01-05 20:58

I have a javascript which sends some specific information to a PHP api . Before to send it performs encodeURI . How can I \"decode\" it in PHP ? I understand that urldecode/

3条回答
  •  误落风尘
    2021-01-05 21:27

    You can use rawurldecode function in php, but this function is not UTF-8, then your have to convert to UTF-8 with utf8_decode like this

    echo utf8_decode(rawurldecode('Educa%C3%A7%C3%A3o%20Multim%C3%ADdia'));
    

提交回复
热议问题