I want to replace a dot wth an underscore
$newstring = preg_replace("/./","_",$string);
replaces all characters in $string with an inderscore (_). How do I make this replace a dot (.) ?
thanks ... Fizz
$newstring = preg_replace("/\\./","_",$string);
You just needed a backslash.
Thank you. Easy when you know how 🙂