replace special characters \\ + * ? [ ^ ] $ ( ) { } = ! <
Posted: Wed Jan 07, 2004 2:21 pm
Does anyone have a working code that will replace special characters:
\\ + * ? [ ^ ] $ ( ) { } = ! < > | :
I have this so far, but it doesn't work for all chareacters
<?
$patterns = array("/`/", "/~/", "/!/", "/@/", "/#/", "/$/", "/%/", "/^/", "/&/", "/{/", "/}/", "/|/");
$filename = preg_replace($patterns, '', $string);
?>
\\ + * ? [ ^ ] $ ( ) { } = ! < > | :
I have this so far, but it doesn't work for all chareacters
<?
$patterns = array("/`/", "/~/", "/!/", "/@/", "/#/", "/$/", "/%/", "/^/", "/&/", "/{/", "/}/", "/|/");
$filename = preg_replace($patterns, '', $string);
?>