看板 PHP 關於我們 聯絡資訊
用 http 可以解決 http://www.php.net/manual/en/ref.http.php CURL 也能解決了,但是如果你不懂原理都是枉然。 http://www.php.net/manual/en/ref.curl.php 不然更低階一點,用 Socket ... Socket http://www.php.net/manual/en/ref.sockets.php ※ 引述《fillmore (.......................)》之銘言: : 尚未解決 : web server看到的跟你client直接讀取網頁的結果會不同,不能夠叫web server去抓網頁 : 結果 恩...幫你抓網頁的應該不是叫做 "web server" 的東西吧? : 讀網頁 file ("http://url"); file 是會傳回陣列,要處理 tag 最好用 file_get_contents : 至於抓 tag : strip_tags ( string str [, string allowable_tags] ) strip tags 是用來去除 tag 用的。不是抓 tag......... : 還有 regular expression : 自己去研究吧 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.223.99.44 ※ 編輯: kornelius 來自: 61.223.99.44 (05/18 13:32)
foxzgerald:除了 cli 之外,執行 php 的不就是 server 嘛 :P ? 05/18 13:44
fillmore:我不是說不能夠抓阿可是抓到的就會不是我想要的了 05/18 13:56
kornelius:web server 只負責呈現 php 產生的結果。 05/18 14:08
foxzgerald:用 php 寫個 client 模擬器放在 server 上 05/18 15:21
fillmore:我的確是這樣寫 05/18 16:11