array( 'proxy' => $proxy[rand() % count($proxy)], // This needs to be the server and the port of the NTLM Authentication Proxy Server. 'request_fulluri' => True, ), ); $cxContext = stream_context_create($aContext); $id = getId(); $str = file_get_contents(getUrl($id), false, $cxContext); if($str) { echo $str . PHP_EOL; $fd = fopen('data/data-' . $id, 'w'); fwrite($fd, $str); fclose($fd); } }