1. Using the XMLHTTP object, similar to the ActiveXObject object in ASP, in fact XMLHTTP is nothing more than get and put operation, in PHP
Get, just use file_get_contents/fopen/readfile these functions.
Put, write their own fsockopen send also line, with Net_curl also line
(Direct use of system functions to be simple, universal, less resource-consuming)
$XHR = new COM ("MSXML2. XMLHTTP ");
$XHR->open ("Get", "http://localhost/xxx.php?id=2", false);
$XHR->send ();
Echo $XHR->responsetext
2. The file_get_contents implementation above says
<?php
$url = "Http://www.blogjava.net/pts";
Echo file_get_contents ($url);
?>
3. The above fopen () implementation
;?
if ($stream = fopen (' http://www.sohu.com ', ' R ')} {
//Print all the page starting at the OFFSE T
Echo stream_get_contents ($stream,-1);
fclose ($stream);
}
if ($stream = fopen (' http://www.sohu.net ', ' r ')) {
//Print the 5 bytes
& nbsp; Echo stream_get_contents ($stream, 5);
fclose ($stream);
}