$var = "mi foto 1.jpg" $var = str_replace("","-",$var); echo $var;
Ver original$var = str_replace(" ","-",$var);