I want to send these three array data into the external api. For that firstly I encode this into JSON, but always it sends the last array.
$params = array( array('receiverName' => 'sample_name',
'receiverEmail' => 'krishanuniyalas@gmail.com',
'senderEmail' => 'info@hotelpalacio.net',
'roomNumber' => '12456',
'accessToken' =>'ca5629d0-6810-11e8-9d40-d7194ac0ac8d'),array('receiverName' => 'sample_name',
'receiverEmail' => 'karamuniyalas@gmail.com',
'senderEmail' => 'info@hotelpalacio.net',
'roomNumber' => '12456',
'accessToken' =>'ca5629d0-6810-11e8-9d40-d7194ac0ac8d'),array('receiverName' => 'sample_name',
'receiverEmail' => 'krishanuniyalas@gmail.com',
'senderEmail' => 'info@hotelpalacio.net',
'roomNumber' => '12456',
'accessToken' =>'ca5629d0-6810-11e8-9d40-d7194ac0ac8d'));
$data_string = json_encode($params);
foreach($params as $pa) {
$r=json_encode($pa);
}
curl_setopt($ch, CURLOPT_POSTFIELDS, $r);