我试图<p>,<br>,<strong>,<b>从以下输入数据中删除所有html标记:
public function init()
{
parent::init();
$this->fields = array(
'name' => 'Name',
'age' => 'Age',
'profile' => 'Profile',
);
$this->mdata = array();
$this->verify = true;
}
Run Code Online (Sandbox Code Playgroud)
任何人都知道如何在其中应用Zend_Filter_StripTags?
如果我理解你的问题:
$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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4211 次 |
| 最近记录: |