我在我的word新聞站點使用下面的代碼。我想通過在我的php代碼中調用wcf web服務來改變一些功能。下面是我使用的是給我的錯誤使用curl時發生500內部服務器錯誤
$Url = "http://localhost:8080/Service1.svc/checkUseronHealnt";
$json = "[{\"MOBILE_NO\":\"8745009403,8745009411\"}]"
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $Url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($json));
$curl_response = curl_exec($curl);
if (curl_error($curl)) {
echo 'error:' . curl_error($curl);
} else {
echo"Response - " . $curl_response;
}
'$ JSON = 「[{\」 MOBILE_NO \ 「:\」 8745009403,8745009411 \ 「}]」'分號該行後失蹤 –