
November 12th, 2006, 01:02 AM
|
|
Registered User
|
|
Join Date: Oct 2006
Posts: 3
Time spent in forums: 7 h 45 m 31 sec
Reputation Power: 0
|
|
|
Regexp, not match
i wanted to remove all html tag except some basic tag like <b>,<p>,<font> etc.
therefore i want to to know how to do that, i tried something like
preg_replace('/<(!b)>.+<\/\1>/i', '**tag removed**', $tempText);
or
preg_replace('/<([^bp])>.+<\/\1>/i', '**tag removed**', $tempText); (this work only for single character tag like '<b>','<p>' but not '<em>'.
example '<script>content content</script>' will be changed to '**tag removed**'
so what i want to do is something like if the tag do not match the tag i allowed, it will remove it.
|