- htmlentities: documentation ( source)
- str_replace: documentation ( source)
- trim: documentation ( source)
- preg_replace: documentation ( source)
<?php
$valor = "Joño dos Santos Videira";
echo str_replace(" ","_",preg_replace("/&([a-z])[a-z]+;/i", "$1", htmlentities(trim($valor))));