How To Remove Html Tags From String In Php
In this article,I will explain how to remove Html tags from string with php.In php we are using strip_tags function to strip HTML and php tags.
strip_tags function returns a string with HTML and PHP tags stripped from a given string.

strip_tags Syntax:
strip_tags(string $string,string $allowable_tags);

Html tags stripper Example:

<?php
$text = '<span>Test </span><p>Html STripper</p>';
echo strip_tags($text);//Strip full string.
echo "<br>";
echo strip_tags($text, '<p>');//Allow <p> tag
?>

Output:
Test Html Stripper.
Test <p>Html STripper</p>