I have this type of curl statement
curl -u xxx:yyy -d "aaa=111" http://someapi.com/someservice
I would like to run this varying aaa=bbb from a list
UPDATE: Code that works, built on Jimmy's code
<?PHP
$data = array('Aaa', 'Bbb', 'Ccc');
echo $data;
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); //Fixes the HTTP/1.1 417 Expectation Failed Bug
curl_setopt($ch, CURLOPT_USERPWD, "xxx:yyy");
foreach ($data as $param) {
curl_setopt($ch, CURLOPT_URL, 'http://...?aaa='.$param);
$response = curl_exec($ch);
echo "<hr>".$response;
}
?>