$license = 'L01234567890123P';
$secret = 'ABCDEFGHIJKLMNOP';
$time = time();
$queries = [
'license' => $license,
'time' => $time,
// 'cnt' => 1, // 代理数(可选)
];
$queries['sign'] = md5($license . $time . $secret);
$url = 'https://api-ip.abuyun.com/obtain?' . http_build_query($queries);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (!$response) {
die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}
echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;
echo 'Response Body: ' . $response . PHP_EOL;
curl_close($ch);