1
<?php
2
3
$max = isset($_REQUEST['i']) ? $_REQUEST['i'] : 1;
4
for($i = 1; $i < 5; $i++) {
5
if ( rand(0,$max) < 1 ) curl();
6
}
7
8
function curl() {
9
global $max;
10
// create a new cURL resource
11
$ch = curl_init();
12
13
// set URL and other appropriate options
14
curl_setopt($ch, CURLOPT_URL, "http://localhost/phpio/test/flow.php?i=".++$max);
15
curl_setopt($ch, CURLOPT_HEADER, 0);
16
17
// grab URL and pass it to the browser
18
curl_exec($ch);
19
20
// close cURL resource, and free up system resources
21
curl_close($ch);
22
}
23