Originariamente inviato da ptransidico
come posso trasformare questa stringa:

gressoney s. j. in

gressoney_s_j

grazie e ciao
$str="gressoney s. j. in"

$str=replace(" ", "", $str);
$str=replace(".", "_", $str);