I am trying to get the contents of a web page up to the 100th character. However, for some reason the code isn't getting the web page at ALL.
Here's my code:
$link = "http://www.roblox.com/User.aspx?ID=1";
echo file_get_contents($link, NULL, NULL, -1, 100);
The reason I am wanting to do this is to get the title of that web page. I cannot figure out why it won't display. Probably the 3rd argument, which I've tried making an alternative for:
$opts = array('http'=>array('method'=>"GET",'header'=>"Accept-language: en\r\n" ."Cookie: foo=bar\r\n");
Even with the above variable set for the 3rd argument it doesn't work. Any suggestions?
file_get_contents
part to a variable andvar_dump
it it's displaying the doctype string. def not null.