- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
strip_tags() function in PHP
The strip_tags() function is used to strip HTML and PHP tags from a string.
Syntax
strip(str, allow)
Parameters
str − The string to check
allow − The allowable tags that won’t be removed (won’t be stripped).
Return
The strip_tags() function returns the stripped string.
Example
The following is an example −
<?php echo strip_tags("<p>Demo <strong>Text!</strong></p>"); ?>
Output
Demo Text!
Example
The following is an example −
<?php echo strip_tags("<p>Demo <strong>Text!</strong></p>","<strong>"); ?>
Output
Demo <strong>Text!>/strong>
Advertisements