public static function remove_attributes($tag, $attrname) {
        if (is_array($attrname)) {
            $attrname = join('|', $attrname);
        }
        while (preg_match('/^(<[^>]*\b)(' . $attrname . ')=".*?"(.*)$/is', $tag, $matches)) {
            $tag = $matches[1] . $matches[3];
        }
        while (preg_match('~^(<[^>]*\b)(' . $attrname . ')([ />].*)$~is', $tag, $matches)) {
            // Some attributes may not have value, for example: <video controls>.
            $tag = $matches[1] . $matches[3];
        }
        return $tag;
    }
public static function remove_attributes($tag, $attrname) {
        if (is_array($attrname)) {
            $attrname = join('|', $attrname);
        }
        while (preg_match('/^(<[^>]*\b)(' . $attrname . ')=".*?"(.*)$/is', $tag, $matches)) {
            $tag = $matches[1] . $matches[3];
        }
        while (preg_match('~^(<[^>]*\b)(' . $attrname . ')([ />].*)$~is', $tag, $matches)) {
            // Some attributes may not have value, for example: <video controls>.
            $tag = $matches[1] . $matches[3];
        }
        return $tag;
    }
public static function remove_attributes ( $ tag , $ attrname ) { if ( is_array ( $ attrname ) ) { $ attrname = join ( '|' , $ attrname ) ; } while ( preg_match ( '/^(<[^>]*\b)(' . $ attrname . ')=".*?"(.*)$/is' , $ tag , $ matches ) ) { $ tag = $ matches [ 1 ] . $ matches [ 3 ] ; } while ( preg_match ( '~^(<[^>]*\b)(' . $ attrname . ')([ />].*)$~is' , $ tag , $ matches ) ) { // Some attributes may not have value, for example: <video controls>. $ tag = $ matches [ 1 ] . $ matches [ 3 ] ; } return $ tag ; }
Removes an attribute from the media tags

@param string $tag html tag which properties are extracted, for example "<video ...>....</video>"
@param string|array $attrname
@return string
Removes an attribute from the media tags