<?php
function bacaHTML($url){
// inisialisasi CURL
$data = curl_init();
// setting CURL
curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($data, CURLOPT_URL, $url);
// menjalankan CURL untuk membaca isi file
$hasil = curl_exec($data);
curl_close($data);
return $hasil;
}
$kodeHTML = bacaHTML('http://www.klikbca.com');
$pecah = explode('<table width="139" border="0" cellspacing="0" cellpadding="0">', $kodeHTML);
$pecahLagi = explode('</table>', $pecah[2]);
?>
<style type="text/css">
.kurs table tr td{
font-size:90%;
}
</style>
<?php
echo '<div class="moduletable"><h3>Kurs Mata uang</h3><div class=kurs>';
echo "<table>";
echo "<tr><td align=center>KURS</td><td align=center>JUAL</td><td align=center>BELI</td></tr>";
echo $pecahLagi[0];
echo "</table></div></div>";
?>
function bacaHTML($url){
// inisialisasi CURL
$data = curl_init();
// setting CURL
curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($data, CURLOPT_URL, $url);
// menjalankan CURL untuk membaca isi file
$hasil = curl_exec($data);
curl_close($data);
return $hasil;
}
$kodeHTML = bacaHTML('http://www.klikbca.com');
$pecah = explode('<table width="139" border="0" cellspacing="0" cellpadding="0">', $kodeHTML);
$pecahLagi = explode('</table>', $pecah[2]);
?>
<style type="text/css">
.kurs table tr td{
font-size:90%;
}
</style>
<?php
echo '<div class="moduletable"><h3>Kurs Mata uang</h3><div class=kurs>';
echo "<table>";
echo "<tr><td align=center>KURS</td><td align=center>JUAL</td><td align=center>BELI</td></tr>";
echo $pecahLagi[0];
echo "</table></div></div>";
?>
and wallaaa... you'll see the result just like this, below
0 komentar:
Post a Comment