例子(php字符串检测函数):
<?php
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<br />line break"));