Like unescape javascript in PHP

Possible duplicate:
How to decode Unicode escape sequences, such as "\ u00ed", for valid UTF-8 encoded characters?

I have javascript text that contains values ​​such as '\ u003c' (less than the <sign).

Are there php functions that allow me to unescape javascript?

(I did not expect urldecode to work, although I tried it. It is not.)

+3
source share
1 answer

yep, just suggest 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');;
  }
?>

Link Strike>

-2
source

All Articles