国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

CURL URL 中的 PHP 變數(shù)
P粉762730205
P粉762730205 2024-02-25 21:03:22
0
1
544

我在這裡搜尋了許多以前的帖子,但似乎沒有任何內(nèi)容可以解決我的問題。簡而言之,我希望在下面的程式碼中包含一個(gè) PHP 變數(shù)。下面的程式碼可以正常工作,因?yàn)樗怯簿幋a的,但是當(dāng)我用變數(shù) $hid (已聲明)替換單字 MAYIAHH 時(shí),出現(xiàn)錯(cuò)誤。

我已經(jīng)嘗試過 CURLOPT_POSTFIELDS 和各種方法,但似乎沒有任何幫助。請(qǐng)問有什麼想法嗎?

function send_request($xml)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 
        'https://rest.reserve-online.net/availability?properties=MAYIAHH');
    curl_setopt($ch, CURLOPT_USERPWD, "uname:pass");
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec($ch);
    curl_close($ch);
    
    return $result;
}

P粉762730205
P粉762730205

全部回覆(1)
P粉771233336

您是否嘗試過連接 url 字串?

$hid = 'MAYIAHH';
$url = 'https://rest.reserve-online.net/availability?properties='.$hid;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "uname:pass");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板