Emphasize

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Emphasize

Post by Shendemiar »

I have a page (a search result) in variable.

Id like to <b>bolden</b> the words one searched for (with srt_replace), but the string also includes html tags. I dont want to add <b> inside a <table> tag...

How to solve this?
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

You just need to create a more complex regex to find where you should make the text bold.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

use preg_replace maybe?
Post Reply