PHP strip_tags() Function

Tips and Notes

Note: HTML comments are always stripped. This cannot be changed with the allow parameter.

Example 1

<?php
echo strip_tags("Hello <b>world!</b>");
?>
The output of the code above will be:
Hello world!


Example 2

<?php
echo strip_tags("Hello <b><i>world!</i></b>","<b>");
?>
The output of the code above will be:
Hello world!

No comments:

Post a Comment