Unicode characters to html entities

09 May 2014

function unicode_escape_sequences($str){  
 $working = json_encode($str);  
 $working = preg_replace('/\u([0-9a-z]{4})/', '&#x$1;', $working);  
 return json_decode($working);  
}

Теги: json php

Категории: Разработка