首页 > Web开发 > 详细

php 去除标签代码

时间:2015-09-19 18:02:40      阅读:306      评论:0      收藏:0      [点我收藏+]

1、strip_tags(string,allow)

 

2、

转编码

$getcontent = iconv(‘gb2312‘,‘utf-8‘,file_get_contents($url));  

 

 

$getcontent = preg_replace( "@<head>(.*?)</head>@is", "", $getcontent );
$getcontent = preg_replace( "@<script(.*?)</script>@is", "", $getcontent );
$getcontent = preg_replace( "@<iframe(.*?)</iframe>@is", "", $getcontent );
$getcontent = preg_replace( "@<style(.*?)</style>@is", "", $getcontent );
$getcontent = preg_replace( "@<(.*?)>@is", "", $getcontent );

php 去除标签代码

原文:http://www.cnblogs.com/lvzhihui/p/4821763.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!