Forum Moderators: coopster
Here's something to get you started that I wrote up real quick:
function Test_Function($match)
{
return $match[1];
}
$string = "OMG! there''''s an eeerooor in this code but maybe it will guide you?";
$pattern = "/([^\w\s])+/";
echo [url=http://us2.php.net/manual/en/function.preg-replace-callback.php]preg_replace_callback[/url]($pattern,"Test_Function",$string);
You may already see the problem; if there are two non-alphanumeric characters next to each other, the latter will be erased. Mess around with it to see what you can get.
...and welcome to webmasterworld! :)