Forum Moderators: coopster
~`!@#$%^&*()_-+=\][{}¦:;"'?/>.<,does anyone know of a function in PHP (if any) that finds only special characters?
preg_match [us3.php.net] ( "/~`!@#$%^&*()_-+=\\][{}¦:;"'?\/>.<,/", $string ); (Note the additional backslashes -actually, you'll need more than them. There's all kinds of special regex characters in there. Use preg_quote [us3.php.net] to scrub the regex.)
So it might look like
preg_match("/".preg_quote("~`!@#$%^&*()_-+=\\][{}¦:;\"'?/>.<,","/")."/", $string);