請幫我我怎樣才能使這個工作,如果它是個右擊辦法做到這一點,如果它不是你會建議發佈參數用一個for循環創建一個字符串,然後使用捲曲後
$str = '';
for($i = 11; $i <= 20; $i++)
{
$str .= $i . ' ';
}
$ch = curl_init(); //http post to another server
curl_setopt($ch, CURLOPT_URL,"http://xxxx");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"username=$username&password=$password&string=$str");
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
print_r($server_output);
curl_close ($ch);
問題是什麼?你得到什麼錯誤?你在期待什麼? – Kami
也許空間是一個問題? – putvande
在手動創建'CURL_POSTFIELDS'值之前,使用'curl_escape'對其進行編碼 - 空格將是一個問題,因爲@putvande建議。另外,關於您實際遇到的問題的提示將非常有用 – DaveyBoy