In this tutorial, We will learn how to check if a string contains HTML tags in PHP. you'll learn PHP to check if the string contains HTML tags. 


$myString = "Hi Rathorji, <p>This is awesome.</p>, help";
if (isHTML($myString)) {
    echo "There is a HTML Tag in String";
    echo "No HTML Tag in String";
function isHtml($string)
  return preg_match("/<[^<]+>/",$string,$m) != 0;


There is a HTML Tag in String