I need to replace all possible html tags in user input but don't want to
replace bold and italic start and end tags, so I made folowing line, but
it replaces only "one-letter-tags" like paragraf or underline tag, it
doesn't replace body, div, span tags...
Can anyone help me with this?
$txt = preg_replace('/<\/?[^bi]>/i', ' ', $txt);
and problem more: I would like to keep <br> tag and would like to change
<p> to <br> (and discard </p>)... and... that's it.
maybe:
(just as idea, those |?\/... are very confusing to me. I'm still novice
in php)
no_html ($txt) {
$input = array ("'<p>tag'",
"'<br>,<b>,<i>,</b>,</i>tags"
"'<any_other>tag'");
$output = array ("'<br>'"
"'<br>,<b>,<i>,</b>,</i>tags'");
"' '");
$txt = preg_replace ($input, $output, $txt);
}
--
Jan ko?
http://fotozine.org
--