作者johnps (皮卡~)
站内PHP
标题[请益] preg_match_all抓不到资料
时间Mon Oct 11 22:11:56 2010
我想要抓
http://0rz.tw/QsPhN的新闻
用
preg_match_all('/class=\"news_title\">(.+?)<\/span>/',$content,$newsti);
有抓到标题
可是
preg_match_all('/<div id=\"newsc\" class=\"news_content\">(.+?)<\/div>/'......
却一直抓不到新闻内容
从原始档怎麽看都是包在
<div id="newsc" class="news_content">
</div>
中间...
print_r出来都是空的
请问我这样写问题是在哪呢?
谢谢<(_ _)>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 134.208.38.182
1F:推 knuckles:.不含换行 改用'/<div>(.+?)<\/div>/s' 10/11 22:51
2F:推 ideaup:(.+?)>(.*) 10/12 06:40
4F:→ foxzgerald:确定一下你设定的正规表示式能选到你想要的内容 10/12 22:38