时间:2010-07-26 15:58:11

标签: php zend-framework

1 个答案:

答案 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

See this SO answer