This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('HTML_REGEX_PATTERN', '/<([a-zA-Z]+)(?:\s([a-zA-Z]+(?:=(?:".+")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/'); | |
function isHtmlTag($text) { | |
return preg_match(HTML_REGEX_PATTERN, $text); | |
} | |
function hasHtmlTag($text) { | |
return preg_match_all(HTML_REGEX_PATTERN, $text); |