码迷,mamicode.com
首页 > Web开发 > 详细

php 去除标签代码

时间:2015-09-19 18:05:25      阅读:186      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!