php - Strip HTML Tags in Zend Framework -


i trying strip html tags except <p>,<br>,<strong>,<b> input data following:

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

anyone knows how apply zend_filter_striptags in it?

if understand 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 input html 

see answer


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -