, etc., but except
), and holds the name of the tag (such as: head, div) in $start_tags wait). The // pattern is used to match closed HTML tags (such as: ,
, etc.). And keep the closed tag name in $end_tags. Then we use the conditional statement count($start_tags[1]) != count($end_tags[1]) to determine whether the starting tag and the closing tag are equal. If they are not equal, it means they are not closed. Finally, use in_array($start_tags[1][$i], $end_tags[1]) to determine whether the start tag and the closing tag are equal. At this point, we have completed the HTML matching!