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