lexington
05-03-2008, 04:21 AM
Hello, I was curious to know how I could use php to take some text from the database and if the text is a match it would surround it with bold html tags? For example if this text is stored in the DB:
one, two, three, four
If the keyword is two, it would output:
one, <b>two</b>, three, four
Remember that the text is static and all stored in the DB and pulled using one variable. I would assume that some explode and pregmatch commands are involved but could anyone provide me with a working example if it isn't too difficult? Thanks!
one, two, three, four
If the keyword is two, it would output:
one, <b>two</b>, three, four
Remember that the text is static and all stored in the DB and pulled using one variable. I would assume that some explode and pregmatch commands are involved but could anyone provide me with a working example if it isn't too difficult? Thanks!
