Home >Backend Development >PHP Tutorial >PHP removes html tags to obtain input plain text document strip_tags

PHP removes html tags to obtain input plain text document strip_tags

不言
不言Original
2018-05-30 14:53:591817browse
<?php
$text = &#39;
Test paragraph.
Other text&#39;;
echo strip_tags($text);
echo "\n";

// Allow

echo strip_tags($text, &#39;
&#39;);
?>

The above example will output: Test paragraph. Other text

Test paragraph.

Other text
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn