$res = preg_replace('/\\\\u([a-f0-9]{4})/e', "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", json_encode($this->response));
Modern way of doing this is:
$res = json_encode($this->response, JSON_UNESCAPED_UNICODE);
JSON_UNESCAPED_UNICODE
added in 5.4 PHP version
by Valeri Tandilashvili
4 years ago
PHP
Encoding
1
Pro tip: use ```triple backticks around text``` to write in code fences