function has_html($string){ if(strlen($string) != strlen(strip_tags($string))){ return true; } return false; } var_dump(has_html("This string doesn't have any html")); var_dump(has_html("This string has aline break")); 复制代码