I need to detect whether a string contains HTML tags.
if(!preg_match(\'(?<=<)\\w+(?=[^<]*?>)\', $string)){ return $string; }
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.