htmlspecialchars strip_tags

<?php

$str = "This is some <b>bold</b> text.";
echo htmlspecialchars($str);
echo '<br>';
echo strip_tags($str);

?>
<hr>
<?php
echo strip_tags("Hello <b>world!</b>");
?>
This is some &lt;b&gt;bold&lt;/b&gt; text.<br>This is some bold text.<hr>
Hello world!

 

posted @ 2017-12-01 11:33  sky20080101  阅读(63)  评论(0)    收藏  举报