yeahz Posted July 7, 2011 Report Share Posted July 7, 2011 function makeClickableLinks($text) { $text = preg_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="\\1" rel="nofollow">\\1</a>', $text); $text = preg_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '\\1<a href="http://\\2" rel="nofollow">\\2</a>', $text); // šī ir 590 rindiņa $text = preg_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})', '<a href="mailto:\\1" rel="nofollow">\\1</a>', $text); return $text; } Warning: preg_replace() [function.preg-replace]: Unknown modifier '(' in *** on line 590 kas par vainu? Quote Link to comment Share on other sites More sharing options...
rpr Posted July 7, 2011 Report Share Posted July 7, 2011 nevar būt () kā modifiers jo tas ir regexp speciālais čars: ieliec priekšā/pakālā kādu citu simbolu. http://lv.php.net/manual/en/reference.pcre.pattern.modifiers.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.