$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