A simple solution is:
if($string != strip_tags($string)) {
// contains HTML
}
The benefit of this over a regex is it’s easier to understand, however I could not comment on the speed of execution of either solution.
A simple solution is:
if($string != strip_tags($string)) {
// contains HTML
}
The benefit of this over a regex is it’s easier to understand, however I could not comment on the speed of execution of either solution.