forked from agusnurwantomuslim/kurs-php
/
chinatrust.php
executable file
·36 lines (36 loc) · 1.44 KB
/
chinatrust.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
<?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/>.
*
*/
// chinatrust.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.chinatrust.co.id/');
$pecah = explode('<div class="textFooter" style="width:170px; margin-left:auto; margin-right:auto;">:', $url);
$pecah2 = explode ('Rates are subject to change without prior notice. For Bank Notes, please consult with customer service.',$pecah[1]);
print_r ($pecah2[0]);
?>