library/Helper/Html.php
public static function stripTagsAndAtts($content, $allowedTags = '', $allowedAtts = '')
    {
        if (isset($allowedTags) && is_array($allowedTags)) {
            $content = strip_tags($content, implode($allowedTags));
        } else {
            $content = strip_tags($content);
        }

        //Strip attributes
        $atts = \Municipio\Helper\Html::getHtmlAttributes($content);

        if ($atts && !empty($atts)) {
            if (isset($allowedAtts) && is_array($allowedAtts)) {
                foreach ($allowedAtts as $attribute) {
                    unset($atts[$attribute]);
                }
            }

            foreach ($atts as $att) {
                $content = str_replace($att, "", $content);
            }
        }

        return $content;
    }
public static function stripTagsAndAtts($content, $allowedTags = '', $allowedAtts = '')
    {
        if (isset($allowedTags) && is_array($allowedTags)) {
            $content = strip_tags($content, implode($allowedTags));
        } else {
            $content = strip_tags($content);
        }

        //Strip attributes
        $atts = \Municipio\Helper\Html::getHtmlAttributes($content);

        if ($atts && !empty($atts)) {
            if (isset($allowedAtts) && is_array($allowedAtts)) {
                foreach ($allowedAtts as $attribute) {
                    unset($atts[$attribute]);
                }
            }

            foreach ($atts as $att) {
                $content = str_replace($att, "", $content);
            }
        }

        return $content;
    }
public static function stripTagsAndAtts ( $ content , $ allowedTags = '' , $ allowedAtts = '' ) { if ( isset ( $ allowedTags ) && is_array ( $ allowedTags ) ) { $ content = strip_tags ( $ content , implode ( $ allowedTags ) ) ; } else { $ content = strip_tags ( $ content ) ; } //Strip attributes $ atts = \ Municipio \ Helper \ Html :: getHtmlAttributes ( $ content ) ; if ( $ atts && ! empty ( $ atts ) ) { if ( isset ( $ allowedAtts ) && is_array ( $ allowedAtts ) ) { foreach ( $ allowedAtts as $ attribute ) { unset ( $ atts [ $ attribute ] ) ; } } foreach ( $ atts as $ att ) { $ content = str_replace ( $ att , "" , $ content ) ; } } return $ content ; }
Strip tags & attributes from String
@param string $content String to get HTML attributes from
@return array       Attributes
Strip tags & attributes from String