How to use strip tags in PHP
In this article I will explain how strip tags function used in PHP.
strip_tags() Function
This function strips a string from HTML, XML, and PHP tags.It mean it used some special tag which can not be changed or removed with the allow parameter.
Syntax
Parameter |
Description |
string |
Required. Specifies the string to check |
allow |
Optional. Specifies allowable tags. |
Example
<html>
<body>
<?php
echo strip_tags("Nitin <b>Bhardwaj!</b>");
?>
<br />
<?php
echo strip_tags("Sachin <b><i>Bhardwaj!</i></b>","<b>");
?>
</html>
</body> |
Output
You may also want to read these related articles Click here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here