fsockopen si usa con qualcosa come:
dipende dalla chiamata curl, ovviamente... :)Codice PHP:
// ESEMPIO FITTIZIO
$fp = fsockopen($host, 80, $errno, $errstr);
if($fp)
{
fwrite($fp,
"GET $request HTTP/1.0\r\n" .
"Host: $host\r\n".
"Connection: close\r\n".
"Content-Length: " . strlen($request) . "\r\n" .
"\r\n" .
$request);
stream_set_timeout($fp, 2, 0);
$response = "";
while(!feof($fp))
$response .= fread($fp, 1024);
fclose($fp);
};