Can someone show me how I can replace all special characters in a string except underscores and period characters. And also I was trying to figure out how to do this in order to replace the templates that read the PHP manual and it is so confusing for a beginner like me, is there any other documentation or tutorial that is simplified for beginners, so I do not need to publish yet one such question and bother people every time I want to use this feature?
preg_replace('/[^a-zA-Z0-9]/', '', $string);
this is what I replace with all special characters, but I want except _ and . .
source share