Skip to main content
bank internasional indonesia

Mengambil Kurs Mata Uang Dari Bank Internasional Indonesia dengan PHP

bank internasional indonesia

Buat sebuah script baru dengan nama bankbii.php, lalu tambahkan script dibawah ini

<?php
function fungsiCurl($url){
$data = curl_init();
curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($data, CURLOPT_URL, $url);
curl_setopt($data, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
$hasil = curl_exec($data);
curl_close($data);
return $hasil;
}
$url = fungsiCurl('http://www.bii.co.id/kurs/Pages/Kurs.aspx');
$pecah = explode('<td valign="top"><div WebPartID="47aac43c-aef3-4ed2-b181-25b45d34d110" HasPers="false" id="WebPartctl00_m_g_47aac43c_aef3_4ed2_b181_25b45d34d110" width="100%" class="ms-WPBody" allowDelete="false" allowExport="false" style="" ><div id="ctl00_m_g_47aac43c_aef3_4ed2_b181_25b45d34d110">',$url);
$pecah2 = explode('</table></td>',$pecah[1]);
echo "<table border=1>";
print_r($pecah2[0]);
echo "</table>";
?>

Jalankan script tersebut di browser, hasilnya seperti gambar dibawah ini
kurs bank international indonesia

Download
[Download not found]

tommy

Adi bekasta encari e, ja pe la lit renggetna.

Leave a Reply

Your email address will not be published. Required fields are marked *