Codice PHP:
$stringa="pippo.nome.com";

$aexplode('.',$stringa);
$stringa=$a[0] . $a[1] . "." .$a[2];