如何解决用php保存没有html内容的txt文档
| 关闭。这个问题需要细节或明确性。它当前不接受答案。解决方法
$html = \'<p>Your < html > here</p>\';
$text = strip_tags($html);
$text = html_entity_decode($text);
echo $text;
输出:Your < html > here
剥离标签doc:http://us.php.net/manual/en/function.strip-tags.php
HTML实体解码文档:http://php.net/manual/en/function.html-entity-decode.php
,<?php
$str = html_entity_decode(strip_tags($str));
?>
,PHP函数strip_tags将为您删除所有的<p>
,而html_entity_decode将修复您的<
和co。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。