views:

22

answers:

1

I have some string with unicode characters and was endcoded with javascript decodeURIcomponent.But i dont find any equivalent in php to decode it.Is there any solution for this?

A: 
urldecode()

However you do not need to use it on $_REQUEST variables, which are already decoded automatically.

tandu
i have used $_POST for fetching,but urldecode() doesnt work on unicode characters.
neo-nant
<?php function utf8_urldecode($str) { $str = preg_replace("/%u([0-9a-f]{3,4})/i","\\1;",urldecode($str)); return html_entity_decode($str,null,'UTF-8');; }?>
tandu