Javatpoint Logo
Javatpoint Logo

PHP string strip_tags() Function

PHP string_tags() is predefine string function of PHP. It is used to strip HTML and PHP tags from a string or strips a string from HTML, XML and PHP tags.

Note 1: This function is binary safe. It return a string with all NULL bytes.

Note 2: HTML comment and PHP tags are also striped. It is hardcoded and can be changed with allowable_tags.


Parameter Description Required/Optional
String Specify the string to check required
Allow Specify allowable tags. Optional

Example 1


Hello PHP!

Note 1: The strip_tags() function is strips a string from HTML, XML, and PHP tags. In this example, the <b> tag gets stripped.

Example 2


Hello Javatpoint!

Example 3


Test paragraph. Javatpoint 
Test paragraph.


Next TopicPHP String

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA