- preg_match: documentation ( source)
- dechex: documentation ( source)
- ord: documentation ( source)
<?php
$string = ' love@outerbanks.org ';
preg_match('/^\x{c2a0}*(.*?)\x{c2a0}*$/u', $string, $out);
for ($i = 0;$i < strlen($out[1]);$i++) {
echo dechex(ord($out[1][$i])).PHP_EOL;
}