Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search and replace to create custom links/html

Status
Not open for further replies.

flugh

Technical User
Aug 23, 2002
655
0
0
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top