作者alpe (薛丁格的猫)
看板PHP
标题Re: [请益] get_contents问题
时间Sat May 18 23:44:27 2013
※ 引述《red0423 (石并大)》之铭言:
: PHP版上各位大家好
: 小弟是PHP新手
: 也已爬过文 可是没有我要的资讯
: 目前我练习写一个file_get_contents用正规表示式
$html = file_get_contents(xx);
preg_match('/Reg_1/', $html, $div1);
echo "<xmp>".print_r($div1).'</xmp>';
preg_match('/Reg_2/', $html, $div2);
preg_match('/Reg_3/', $html, $div3);
: 判断我要抓的那个div区块
: 这样是ok的 也抓得回我要的资讯
: 可是假如我还要抓另外两个div区块
以前要偷人家网页都是这样的.
--
Live Long and Prosper
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.31.105.62
1F:推 a60301:(长ID保留区) 推 preint_r 05/20 02:52
2F:→ alpe:啊... .... 多按到一个e 05/20 09:27
※ 编辑: alpe 来自: 114.34.87.32 (05/20 09:28)