cURL无法与if语句一起使用,我该怎么办? 在if语句中使用cURL。
<?php
$referralpixel_url = (isset($_COOKIE['referral-pixel-pixel_url'])) ? $_COOKIE['referral-pixel-pixel_url'] : 0;
if($referralpixel_url != 0)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $referralpixel_url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_exec($ch);
curl_close($ch);
}
?>