[eluser]sophistry[/eluser]
happy birthday! here's a present for you...
preg_replace() is the function you need.
regex pattern for the preg_replace() function (assumes whitespace before pound sign #):
replacement:
Code:
'<a href="http://example.com/tags/$1">$1</a>'
give that a try.
EDIT: added i switch to the regex pattern to make it case insensitive.