[英]What's the difference between file_get_contents a variable and a string?
我有源代碼:
一種。
$this->eArticle["product_link"] = 'http://afamily.vn/doi-song/lop-hoc-toa-tau-day-nham-mat-ve-obama-khien-tre-thich-me-20150530074455878.chn';
print file_get_contents($this->eArticle["product_link"]);
和
B.
print file_get_contents('http://afamily.vn/doi-song/lop-hoc-toa-tau-day-nham-mat-ve-obama-khien-tre-thich-me-20150530074455878.chn');
在A中,結果返回NULL( screen haven't text
)
在B中,結果顯示網站http://afamily.vn/doi-song/lop-hoc-toa-tau-day-nham-mat-ve-obama-khien-tre-thich-me-20150530074455878.chn
為什么呢 如何解決? 謝謝 !
我不太確定你做了什么,但是
您可以嘗試將其存儲在變量中,函數是file_get_contents()
而不是file_get_content()
,請注意您錯過的“ s”
$this->eArticle["product_link"] = 'http://afamily.vn/doi-song/lop-hoc-toa-tau-day-nham-mat-ve-obama-khien-tre-thich-me-20150530074455878.chn';
$website_link = trim($this->eArticle["product_link"]);
echo file_get_contents($website_link);
查看文檔
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.