Home >>PHP String Functions >PHP strip_tags() Function
PHP strip_tags() function is used to strips a given string from HTML, and PHP tags. It return a string as output which contains all NULL the bytes, HTML and PHP tags stripped from a given input string
Syntax:
strip_tags($string,$allow);
Parameter | Description |
---|---|
string | This is a required parameter. This parameter defines the string to check. |
allow | This is an optional parameter. This parameter defines tags that will not be removed. |
Here is an example of strip_tags() function in PHP:
<html> <body> <?php echo strip_tags("<b>PHPTPOINT</b>"); ?> </body> </html>
Here is an another example of strip_tags() function in PHP:
<html> <body> <?php $str = "<b>PHPTPOINT</b>"; echo $str; echo "<br>"; echo strip_tags($str); ?> </body> </html>