I am trying to implement an open source string-to-link converter, but i have an error and I frankly have tried everything and do not know what is wrong. Here is the code:
$chatmessage = preg_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)',
'<a href="'.$chatmessage.'" target=_blank
style="color:#6B6B6B;">'.$chatmessage.'</a>', $chatmessage);
Here is the error that I get:
Warning: preg_replace() [function.preg-replace]: Unknown modifier '(' in /echogetconversation.php on line 38. line 38, is this:
'<a href="'.$chatmessage.'" target=_blank
style="color:#6B6B6B;">'.$chatmessage.'</a>', $chatmessage);
If anyone could assist me it would be greatly appreciated.