This code
print mb_substr(\'éxxx\', 0, 1);
prints an empty space :(
It is supposed to print the first character, é. This seems
é
Try passing the encoding parameter to mb_substr, as such:
print mb_substr('éxxx', 0, 1, 'utf-8');
The encoding is never detected automatically.