Jump to content

Any help with this preg_replace?


Guest

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.