Keep HTML tags, but strip attributes

From: Date: Sat, 03 Apr 2004 21:41:35 +0000
Subject: Keep HTML tags, but strip attributes
Groups: php.general 
Request: Send a blank email to php-general+get-182259@lists.php.net to get a copy of this message
I am building a system which allows users to post data. I want to allow them to use ONLY certain tags such as <p>, </p>, <b>, </b>, <i>, </i>, etc... I want to allow them to use only these, and then strip out ALL attributes inside the tags. So if they input something like <p junk=junk>, it would switch it to just <p>. Anyone know of a way this can be done? Thanks, Matt Palermo http://sweetphp.com

« previous php.general (#182259) next »