'I couldn't remove the ":" in html in PHP

I want to remove the ":" sign in the span end. But this always caused the error. It does not accept any other sign. How can this happen?

Why is this simple process so difficult? Can anyone give details on this?

Short Code '&nbsp;<span class="required">*</span>' : ''

Full Code

if ( wc_review_ratings_enabled() ) {
    $comment_form['comment_field'] = '<div class="comment-form-rating"><label for="rating">' . esc_html__( 'Your rating', 'woocommerce' ) . ( wc_review_ratings_required() ? '&nbsp;<span class="required">*</span>' : '') . '</label><select name="rating" id="rating" required>
        <option value="">' . esc_html__( 'Rate&hellip;', 'woocommerce' ) . '</option>
        <option value="5">' . esc_html__( 'Perfect', 'woocommerce' ) . '</option>
        <option value="4">' . esc_html__( 'Good', 'woocommerce' ) . '</option>
        <option value="3">' . esc_html__( 'Average', 'woocommerce' ) . '</option>
        <option value="2">' . esc_html__( 'Not that bad', 'woocommerce' ) . '</option>
        <option value="1">' . esc_html__( 'Very poor', 'woocommerce' ) . '</option>
    </select></div>';
}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source