G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 8th, 2020 188 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.    
  3.     function getCurl($url) {
  4.         $ch = curl_init();
  5.         curl_setopt($ch, CURLOPT_URL, $url);
  6.         curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);
  7.         $result = curl_exec($ch);
  8.         curl_close($ch);
  9.         return json_decode($result, true);
  10.     }
  11.  
  12.  $kode_wilayah1 = "190200";  // Kab.Pangkep
  13.     // alamat API
  14.     $url_daftar_sekolah = "http://jendela.data.kemdikbud.go.id/api/index.php/Csekolah/rekapSekolahGET?mst_kode_wilayah=".$kode_wilayah1;
  15.    
  16. $result =getCurl($url_daftar_sekolah);
  17.  
  18. ?>
  19.  
  20. <!DOCTYPE html>
  21. <html lang="en">
  22. <head>
  23.     <meta charset="UTF-8">
  24.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  25.     <title>Daftar Sekolah</title>
  26. </head>
  27. <body>
  28.     <table>
  29.         <tr>
  30.             <th>Kecamatan</th>
  31.             <th>Kategori</th>
  32.             <th>Jumlah</th>
  33.         </tr>
  34.         <?php foreach($result as $row) : ?>
  35.         <tr>
  36.             <td><?= $row['data']['wilayah']; ?></td>
  37.             <td><?= $row['data']['bentuk']; ?></td>
  38.             <td><?= $row['data']['sekolah']; ?></td>
  39.         </tr>
  40.         <?php endforeach; ?>
  41.     </table>
  42. </body>
  43. </html>
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top