$stringa = "ciao lorenzos";
$ultime3 = substr($stringa,-3); //restituisce zos
echo $ultime3;