Reputation: 9040
I need to write a regular expression using php which parses the following code block and removes all <font>
and </font>
tags.
<p align="left"><font face="Arial" size="1">February 22, 2007</font></p>
<p align="left"><b><font face="Arial" size="4">2K Sports Announces Major League
Baseball 2K7 Has Gone Gold </font></b></p>
Upvotes: 0
Views: 107
Reputation: 105878
You don't need regex at all
echo strip_tags( $html, '<b><p>' );
Upvotes: 2
Reputation: 3323
$myString = preg_replace("/<([\/]*)font(.*?)>/","",$myString);
should do the trick.
Edit: Just added some magic I forgot earlier... ashes upon me :)
Upvotes: 2