script GetCountMahasiswa di webservice 2.2 PDDIKTI
script GetCountMahasiswa di webservice 2.2 PDDIKTI
//init
$ch2 = curl_init();
curl_setopt($ch2,CURLOPT_HTTPHEADER,$headers);
//run function GetCountMahasiswa
$data=array('act'=>'GetCountMahasiswa','token'=>$token);
$data=json_encode($data);
curl_setopt($ch2,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch2,CURLOPT_URL,$url);
curl_setopt($ch2,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch2);
//json
$data=json_decode($result);
//tampilkan data
echo "<br>Jumlah Mahasiswa : " . $data->data;