- substr: documentation ( source)
- chr: documentation ( source)
- trim: documentation ( source)
- str_split: documentation ( source)
- ord: documentation ( source)
<?php
function ordArray($email) {
$partes = str_split(trim($email));
$nuevo = '';
foreach ($partes as $valor) {
$nuevo .= '&#'.ord($valor).';';
}
return $nuevo;
}
function chrArray($email) {
echo $email;
$partes = str_split(trim($email, ' '));
$nuevo = '';
foreach ($partes as $valor) {
$nuevo .= chr(substr($valor, 2, strlen($valor) - 1));
}
return $nuevo;
}
echo chrArray(ordArray('abc123 sasd ewrqewr werewr wererw'));