Codice PHP:
$prova "prova variabile prova";
$stringa=str_replace(" ","-",$prova);
print 
$stringa