forked from agusnurwantomuslim/kurs-php
/
sinarmas.php
39 lines (38 loc) · 1.4 KB
/
sinarmas.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Kurs Bank Bank di Indonesia
*
* @author tommy
* @copyright 2013 Tommy A. Surbakti tommy@surbakti.net
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
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>";
?>