Greetings,
I have items in a database, and want to create a little custom markup. What I'd like to do is be able to search my text and replace "[mylink=37]" with "<a href= link text looked up based on the '37' or whatever the value is)</a>". I found some code that let's me replace "[mylink=37]sometext[/mylink]", but I'd rather the text be drawn from the database dynamically for easier content management (a lot of reusing data going on). Some proper search terms to throw at Google would be even be helpful, as 'php search replace custom markup html' gets me a lot of template engines and wiki snippets, etc. I'm thinking this is pretty much a one-liner, just been a few years since I tinkered with php.
Thanks in advance for any help or advice. Apologies for slow response, will be tonight before I can get back online.
----
JBR
I have items in a database, and want to create a little custom markup. What I'd like to do is be able to search my text and replace "[mylink=37]" with "<a href= link text looked up based on the '37' or whatever the value is)</a>". I found some code that let's me replace "[mylink=37]sometext[/mylink]", but I'd rather the text be drawn from the database dynamically for easier content management (a lot of reusing data going on). Some proper search terms to throw at Google would be even be helpful, as 'php search replace custom markup html' gets me a lot of template engines and wiki snippets, etc. I'm thinking this is pretty much a one-liner, just been a few years since I tinkered with php.
Thanks in advance for any help or advice. Apologies for slow response, will be tonight before I can get back online.
----
JBR