答案 0 :(得分:8)
如果我理解你的问题:
$allowedTags = array('p','b','br','strong'); // Allowed tags
$allowedAttributes = array('href'); // Allowed attributes
$stripTags = new Zend_Filter_StripTags($allowedTags,$allowedAttributes); // instance of zend filter
$sanitizedInput = $stripTags->filter($input); //$input is input html