03-17-2010, 11:18 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Mar 2010
Posts: 9
Thanks: 2
|
Trouble using regexps to explude HTML tags
Hello:
My goal is to remove all HTML tags except the following:
// <b> and </b> = Bold;
// <i> and </i> = Italic;
// <u> and </u> = Underline;
// <ul> and </ul> = List;
// <ol> and </ol> = List;
// <li> and </li> = Bullet;
// <br> = Line Break;
So if I use the following line:
PHP Code:
$res = preg_replace("/<\/?(b|i|u|ul|ol|li|br){1}>/i", "", $raw);
it removes the tags that I need and keeps the rest of them.
My question is how to "reverse" it?
|
|
|
|