bank sinarmas

Untuk situs Bank Sinarmas, bisa diakses di banksinarmas.com. Script lengkapnya bisa dilhat 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.banksinarmas.com/id/i.php?id=exchangeRates');
$pecah = explode('<table width="100%" cellpadding="0" cellspacing="1" align="center" bgcolor="#E1E3E3">',$url);
$pecah2 = explode('  </tr>
  <tr>',$pecah[1]);
echo '<table border=1>';
print_r($pecah2[0]);
echo "</table>";
?>

sebelum menjalankan script diatas, di PHP anda harus sudah terinstall library CURL. Bila ada pertanyaan atau saran bisa kita diskusikan melalui komentar :)

Download “Bank Sinarmas” sinarmas.zip – Downloaded 3578 times – 178.00 B

Leave a comment

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