Add - in a string in php by using str_replace funtion
$var="my name is saddam hussain ";
$var=str_replace(" ","-", $var);
$var=str_replace("_","-", $var);
$var=trim($var);
$var="my name is saddam hussain ";
$var=str_replace(" ","-", $var);
$var=str_replace("_","-", $var);
$var=trim($var);
Comments
Post a Comment