Possible Duplicate:
How to decode Unicode escape sequences like “\u00ed&rdquo开发者_JAVA技巧; to proper UTF-8 encoded characters?
I have some javascript text that contains values like '\u003c' (less than sign <).
Is there a php functions that allows me to unescape javascript ?
(I did not expect urldecode to work, though i tried it. It does not indeed.)
yep, would just suggest it, urldecode();
Try:
<?php
function utf8_urldecode($str) {
$str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str));
return html_entity_decode($str,null,'UTF-8');;
}
?>
Reference
精彩评论