HTML tag striping in Zend Framework

I am trying to remove all html tags except <p>,<br>,<strong>,<b> from the input from the following:

  public function init() { parent::init(); $this->fields = array( 'name' => 'Name', 'age' => 'Age', 'profile' => 'Profile', ); $this->mdata = array(); $this->verify = true; } 

Does anyone know how to apply Zend_Filter_StripTags in it?

+4
source share
1 answer

If I understand your problem:

 $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 answer "SO"

+8
source

All Articles