- substr: documentation ( source)
- hex2bin: documentation ( source)
- preg_replace_callback: documentation ( source)
<?php
$in = '\u00E3\u0081\u0082a';
$out = preg_replace_callback('/\\\\u[0-9A-F]{4}/', function ($matches) { return hex2bin(substr($matches[0], -2, 2)); }, $in);
echo $out;