Error lengkapnya

PHP Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, ‘<' not found in /var/www/html/kursrupiah/bank/uob.php on line 10 PHP Warning: simplexml_load_string(): HTTP/1.1 200 OK in /var/www/html/kursrupiah/bank/uob.php on line 10 PHP Warning: simplexml_load_string(): ^ in /var/www/html/kursrupiah/bank/uob.php on line 10 PHP Notice: Trying to get property of non-object in /var/www/html/kursrupiah/bank/uob.php on line 18 PHP Warning: Invalid argument supplied for foreach() in /var/www/html/kursrupiah/bank/uob.php on line 18

Karena saya menggunakan curl untuk mendownload halaman website Bank UOB, karena CURLOPT_HEADER true, maka semua header ikut di ambil, sehingga hasil XML tidak valid/tidak bisa diparsing oleh simplexml_load_string.
di script yang saya gunakan CURLOPT_HEADER bernilai true

curl_setopt($curl, CURLOPT_HEADER, true);
# atau 
curl_setopt($curl, CURLOPT_HEADER, 1);

ganti CURLOPT_HEADER menjadi false.

curl_setopt($curl, CURLOPT_HEADER, false);
# atau 
curl_setopt($curl, CURLOPT_HEADER, 0);

Last Updated on 16 January 2018 by tommy

Leave a comment

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