怎么去掉php标签.. 先将文件读到一个字串,然后preg_replace('/^<[\\?].*[\\?]>/i','',$o_string);楼主试试,突然忘记很多正则语法了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不懂怎么提取这些html。你如果html里面也有类似php的代码呢?怎么提取? 你是说你只要<html><head><meta http-equiv=Content-Type content=text/html; charset=gb2312><meta name=GENERATOR content=Microsoft FrontPage 4.0><meta name=ProgId content=FrontPage.Editor.Document>这些吗?这有什么意义呢?不都是你写进去的吗? to xuzuning(唠叨):是我写进去的啊,,可是现在我想过滤掉,把他做成html页面..而不是php. $s = file_get_contents("http://localhost/page.php");就可得到html代码了 /*** 去掉字符串的html标签** @param string $str 包含html代码的字符串* @return $text 去掉html标签后的纯洁字符串*/function html2txt($str){$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA);$text = preg_replace($search, '', $str);return $text;} 怎样做到倒计时在不同客户端完全同步 急!请问如何才能捕捉到这个跳转页面? js调用php函数--困难问题。。。 (在线等)怎么建立一个表格的时候,就让这个表格隐藏呢? 加载页面时的问题 请看一下这个登陆框怎样制作和使用? 谁有http://www.chinaelate.com/myedit/edit.htm上的在线HTML编辑器的源代码?谢谢 怎样连接Oracle? 有没有像$REMOTE_ADDR读取IP的常量读取当前打开的网址(在线等) php的3des加密 框架网页,不想让部分框架出现滚动条,如何只让整个网页出现滚动条? 有谁能帮我找一篇有关PHP新闻发布系统的毕业论文!
<html><head>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<meta name=GENERATOR content=Microsoft FrontPage 4.0>
<meta name=ProgId content=FrontPage.Editor.Document>
这些吗?
这有什么意义呢?不都是你写进去的吗?
是我写进去的啊,,可是现在我想过滤掉,把他做成html页面..而不是php.
就可得到html代码了
* 去掉字符串的html标签
*
* @param string $str 包含html代码的字符串
* @return $text 去掉html标签后的纯洁字符串
*/
function html2txt($str)
{
$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
);
$text = preg_replace($search, '', $str);
return $text;
}