Thanks suntra, but your code has a fault - the fclose should be outside rather than inside the while{}, i.e.
$contenu = array(); // variavle that will contain the contents of the site
$svr = "server.com"; // server address, WITHOUT the [url]http://[/url]
$port = 80; // port
$errno = "";
$errstr = "";
$fch = "/directory/file.extension"; // the file you want to get, WITHOUT the server
$userAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)";
$enr = false;
$fp = fsockopen($svr, $port, $errno, $errstr, 30);
if(!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs($fp, "GET $fch HTTP/1.0\r\nHost: $svr\r\nUser-agent: $userAgent\r\n\r\n");
while(!feof($fp)) {
$lgn = fgets($fp, 4096);
if($lgn == "\r\n" && !$enr) {
$enr = true;
}
if($enr && $lgn !="\r\n") {
$contenu[] = $lgn;
}
}
fclose($fp);
}