php怎么检测字符串是否包含html代码
时间:2021-07-01 10:21:17
帮助过:26人阅读
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 a
line break"));
|