Codice PHP:
function controlla_user(&$user)
{
$find = array(' ','&','\r\n','\n','/','\\','+');
$user = str_replace ($find, '-', $user); // sostituisce con un - tutti i
// caratteri contenuti nell'array
// $find.
$find = array(' ','�','�','�','�');
$user = str_replace ($find, 'e', $user);
$find = array(' ','�','�','�','�');
$user = str_replace ($find, 'o', $user);
$find = array(' ','�','�','�','�');
$user = str_replace ($find, 'a', $user);
$find = array(' ','�','�','�','�');
$user = str_replace ($find, 'i', $user);
$find = array(' ','�','�','�','�');
$user = str_replace ($find, 'u', $user);
$find = array('/[^a-z0-9\-<>\.]/','/[\-]+/','/<[^>]*>/');
$repl = array('','-','');
$user = preg_replace ($find, $repl, $user);
return $user;
}