- trim: documentation ( source)
- str_split: documentation ( source)
- ord: documentation ( source)
<?php
function encryptMail($email) {
$parts = str_split(trim($email));
$encrypted = '';
foreach ($parts as $part) {
$encrypted .= '&#'.ord($part).';';
}
return $nuevo;
}
echo encryptMail('abc123 sasd ewrqewr werewr wererw');