0
我想用PHP curl或file_get_contents函數發送GET請求時遇到問題!!! 我認爲這個問題是爲我的網址! 請幫我...我 碼(的file_get_contents功能):如何用PHP curl發送GET請求
$SMStext = "text";
$SMSmobile = 'phonenumber';
$SMSurl = "http://api.payamak-panel.com/post/sendsms.ashx?username=username&password=pass&from=smsnumber&to=";
$SMSurl .= $SMSmobile;
$SMSurl .= '&text=';
$SMSurl .= $SMStext;
echo file_get_contents($SMSurl);
我的代碼(PHP的捲曲):
$SMStext = "text";
$SMSmobile = 'phonenumber';
$SMSurl = "http://api.payamak-panel.com/post/sendsms.ashx?username=username&password=pass&from=smsnumber&to=";
$SMSurl .= $SMSmobile;
$SMSurl .= '&text=';
$SMSurl .= $SMStext;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$SMSurl);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
// curl_setopt($ch,CURLOPT_HEADER, false);
$output=curl_exec($ch);
curl_close($ch);
echo $output
的可能的複製[PHP捲曲GET請求,請求體(https://stackoverflow.com/questions/17230246/php-curl-get-request-and-requests-body) –