How to exclude labels from certain categories in a shortcode?

Good afternoon. There is a shortcode [alltags] that displays ALL site tags on a separate page of the site in alphabetical order with a letter.

function wph_alltags_shortcode( $atts, $content ) {
    $posttags = get_tags();
    $output = '';
    if ( $posttags ) {
        $output = 'dl class=alltags';
        foreach ( $posttags as $tag ) {
            $l = mb_strtoupper( mb_substr( $tag-name, 0, 1, 'UTF-8'), 'UTF-8' );
            if ( $L != $l ) {
                if ( $L )
                    $output .= '/dd';
                $L = $l;
                $output .= 'dt' . $L . '/dtdd';
            }
            $output .= 'a href=/tag/' . $tag-slug . '' . $tag-name . '/a '; 
        }
        $output .= '/dl';
    }
    return $output;
}
add_shortcode( 'alltags', 'wph_alltags_shortcode' );

I need to exclude the display of tags from certain categories of the site, at least from one. I am completely new to PHP. (Please help me with solving this problem. Thank you very much in advance!

Topic shortcode tags php Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.