How to transfer `\u0627` into utf-8(php) [duplicate]
Possible Duplicate:
How to decode Unicode escape sequences like “\u00ed” to proper UTF-8 encoded character开发者_Python百科s?
$str = '\u0627\u0644\u0631\u0626\u064a\u0633';
How to transfer it into utf-8? thanks.
$str = '\u0627\u0644\u0631\u0626\u064a\u0633';
$converted = preg_replace('/\\\u([0-9a-z]{4})/i', '&#x$1;', $str);
echo $converted; // displays الرئيس
$str = '"\u0627\u0644\u0631\u0626\u064a\u0633"';
echo json_decode($str);
精彩评论