php - What's the difference between file_get_contents a variable and a string? -


i have source code :

a.

$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"]); 

and

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'); 

in a, result return null ( screen haven't text )

in b, result display website http://afamily.vn/doi-song/lop-hoc-toa-tau-day-nham-mat-ve-obama-khien-tre-thich-me-20150530074455878.chn

why ? how fix ? !

i nt quite sure did but

you can try storing in variable , function file_get_contents() , not file_get_content(), note "s" have missed

$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); 

check out docs


Comments