Skip to content

Instantly share code, notes, and snippets.

@swuppio
Created September 22, 2019 22:51
Show Gist options
  • Save swuppio/e586cb8f0d7e7be8d98ef143ae77fd45 to your computer and use it in GitHub Desktop.
Save swuppio/e586cb8f0d7e7be8d98ef143ae77fd45 to your computer and use it in GitHub Desktop.
<?php
$i = 1;
while (true) {
$opts = [
'http'=> [
'method'=> "GET",
'header'=>
"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n"
]
];
$context = stream_context_create($opts);
$res = @file_get_contents('http://ya.ru', false, $context);
echo (!empty($res) ? 'SEND: '.$i. ' time: '. date('H:i:s') : 'DIE') . PHP_EOL;
$i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment