SyntaxFix
Write A Post
Hire A Developer
Questions
do this in two steps:
replace not letter characters with this regex:
[\/\&%#\$]
replace quotes with this regex:
[\"\']
and use preg_replace:
preg_replace
$stringWithoutNonLetterCharacters = preg_replace("/[\/\&%#\$]/", "_", $yourString); $stringWithQuotesReplacedWithSpaces = preg_replace("/[\"\']/", " ", $stringWithoutNonLetterCharacters);