看板 PHP 關於我們 聯絡資訊
我想include一個網站的內容 include("http://www.xxx.xxx"); 可是我常常遇到想要做一些處理的動作 所以想把它寫進變數 $a 就變成 $a=include("http://www.xxx.xxx"); 結果當然是沒辦法 有什麼比較好的解決方法呢? 當然像是文件,可以用 file_get_contents 就能寫進變數 那網頁有比較好的函數嗎? 先謝謝大家了^^ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.164.196
yanli2:變數和連結統一在$a處理 最後只要 include ($a) 05/24 22:05
yo0401:感謝,不過不太懂,可以寫個範例嗎? 05/24 22:20
foxzgerald:做哪些處理的動作阿? 05/24 23:02
alpe:eval($a)!? 05/25 00:04
yo0401:例如split切割、str_splace取代………等,所以才想寫進變數 05/25 00:04
foxzgerald:hmm... 所以你是想要解析你抓來的 html 嘛? 05/25 01:05
foxzgerald:如果是的話.. include() 不太適合您的需求 05/25 01:11
foxzgerald:此外,請參考 kornelius 在 3500 和 3505 的回覆 :) 05/25 01:15