Guest Posted October 28, 2011 Share Posted October 28, 2011 I'm trying to alow users to reference links, but I'm stumped. $com = preg_replace("/(^|<<)(<<[^<]*[0-9])/", "\\1<a href = #".$com.">#$com</a>\\2</div>", $com); If I typed <<#123 I would get: #<<123<<123 and it would link to <<123 The output I'm looking for is <<#123 and have it link to #123 Link to comment https://forums.phpfreaks.com/topic/250010-any-help-with-this-preg_replace/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.