Perban sangana kisat nulis tutorial lengkapna, jadi kubereken saja script lengkapna ;).

Sope lenga banci idalanken script enda, download lebe simple_html_dom.php arah simplehtmldom.sourceforge.net

<?php
// bca.php
	include_once ('simple_html_dom.php');
 
// enda langsung mbuat datana arah situs BCA
// simejilena min simpan lebe, contoh download alu wget http://www.bca.co.id/id/kurs-sukubunga/kurs_counter_bca/kurs_counter_bca_landing.jsp -O bca.html
// dung e ganti jadi file_get_html('bca.html');
// gelahna ula i blokir BCA ip-ta
 
	$html = file_get_html('LINK.KURS.BCA');
	$table = $html->find('table', 2);
	$rowData = array();
	function remove_element_by_value($arr, $val)
	{
		$return = array();
		foreach($arr as $k => $v)
		{
 
			if(is_array($v))
			{
				$return[$k] = remove_element_by_value($v, $val);
				continue;
			}
 
 
			if($v == $val) continue;
			$return[$k] = $v;
		}
 
		return $return;
	}
 
	foreach($table->find('tr') as $row)
	{
		$datana = array();
		foreach($row->find('td') as $cell)
		{
			$datana[] = $cell->plaintext;
		}
 
		$rowData[] = remove_element_by_value($flight,'&nbsp;&nbsp;');
		$rowData2 = $rowData;
	}
 
	$arrayx = array_values(array_filter($rowData2));
	$jumlah_array = count($arrayx);
	$jual = array();
	for ($ab = 0 ; $ab < $jumlah_array; $ab++)
	{
		$databaru = $arrayx[$ab][3];
		$jual[] = $databaru;
	}
 
	$inputjual =  implode(', ', $jual);
	$beli = array();
	for ($ab = 0 ; $ab < $jumlah_array; $ab++)
	{
		$databaru = $arrayx[$ab][1];
		$beli[] = $databaru;
	}
 
	$inputbeli =  implode(', ', $beli);
	echo "<h3>Kurs Beli</h3>";
	echo "<hr>";
	print_r($inputbeli);
	echo "<h3>Kurs Jual</h3>";
	echo "<hr>";
	print_r($inputjual);
?>

tampilen scriptna kenca i dalanken
kurs dolar bca

Adina masalah tampilenna pake HTML gelahna mejile idah, enda contohna sikuban ku tabel
kurs pake tabel

Cara Mbuat Kurs Arah Situs BCA
Tagged on:     

Leave a Reply

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