Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = 'http://jendela.data.kemdikbud.go.id/api/index.php/Csekolah/detailSekolahGET?mst_kode_wilayah=010100&bentuk=sd';
- $curl = curl_init($url);
- // Returns the data/output as a string instead of raw data
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_HTTPHEADER, ['Accept:application/json']);
- $data = curl_exec($curl);
- curl_close($curl);
- // Deal with BOM, refer to
- // https://stackoverflow.com/questions/689185/json-decode-returns-null-after-webservice-call
- $data = substr($data, 3);
- $res = json_decode($data);
- print_r($res);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement