View Single Post
Old Jan 2nd, 2008, 10:48 AM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Best Way To Strip Certain Tags From A String

I have a string handled by PHP. What's the best way to strip all "font" tags from that string? For example, I want $new_mystr to be obtained from $mystr.

E.G. Input
$mystr = '<div class="content"><p>Hello to all. <font face="Calibri"><font size="3">Goodbye</font></font></p></div>';

E.G. Output
$new_mystr = '<div class="content"><p>Hello to all. Goodbye</p></div>';
Sane is offline   Reply With Quote