-3
我想在curl中傳遞嵌套數組。當我嘗試這是錯誤味精,我得到如何在curl中傳遞嵌套數組
"(!) Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in line 39"
itmean「=>」這個語法是錯誤的
我嘗試用它也不能工作了支架。我怎樣才能傳遞這個數組?
$baseurl = 'http://202.124.173.187/api/v1/payConfirm';
$rawPOSTdata = array
(
"deviceCode"=>"",
"applicationId"=>"",
"patient",(
"member"=>"",
"needSMS"=>"true",
"nsr"=>"",
"foreign"=>"",
"teleNo"=>"0777136419",
"title"=>"mrs",
"patientName"=>"sufra",
"nid"=>"887111596v",
)
"sessionDetails",
(
"hosId"=>"H138",
"docId"=>"D3648",
"theDay"=>"Monday",
"startTime"=>"13:00",
"theDate"=>"03-10-2016",
)
"payment",
(
"paymentMode"=>"EPG",
"bankCode"=>"",
"branchCaode"=>"M000444",
"paymentChannel"=>"WEB_PO",
"channelFrom"=>"W",
)
);
$curl = curl_init($baseurl);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-type: multipart/form-data',"Authorization: Bearer $atoken"));
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($rawPOSTdata));
$response = curl_exec($curl);
curl_close($curl);
if($response)
{
if (isset($result->error))die($result->error_message);
/* Convert json data to array */
$arr=json_decode($response,true);
echo '<pre>';echo print_r ($arr); echo '</pre>';
編碼您的陣列。 – aldrin27
「patient」=> array( – CatalinB
)「sessionDetails」is'),「sessionDetails」=> array(' – CatalinB