- mb_convert_encoding: documentation ( source)
- pack: documentation ( source)
<?php
class utils {
function replace_unicode_escape_sequence($match) {
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
}
public static function to_decode($str) {
return "hej";
}
}
$str = '{"name":"F\u00f6retag: Betalning"}';
echo utils::to_decode($str);