I found out that file_get_contents is the key.
simplexml_load_string() not working because of parser error/
This is the error message.
Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in test.php on line XXX
Most of the stackoverflow answer are "use utf8_encode()", but that is no help.
Use var_dump() the data and it's looks like garbled data, but if I download the file directly, it seems no problem.
simplexml_load_string() is not the problem, file_get_contents just returned garbled data!
I end up find out that it's not display garbled because php can't detect file_get_contents returned date's encode.
file_get_contents returned date is just garbled.
Response data is being compressed!
if file_get_contents gets GZ compressed data(gzip/zlib), it's display garbled.
What you need is just put "compress.zlib://" before url.
file_get_contents('compress.zlib://http://example.com');
How to hide Navigation Toolbar in Firefox Nightly for Android.(disable new double address bar)
How to change Thunderbird like Gmail Basic HTML view.(userChrome.css)
OpenSea scams surge! Beware of Phishing mail.
How to emulate mobile device in Firefox browser when user-agent spoofing is not enough.
[Android]How to solve White Fade issue at the top of Home Screen
[Android Chrome]How to hide News/Recipes icons in New Tab Page[Disable query tiles]
[PHP]Fix simplexml_load_string() parser error. (file_get_contents returning garbled data)
[Wordpress]Fix automatically inserting read.amazon.com.au iframe card.
[Windows10]Fix Missing Arrows in explorer context menu(missing system font)
How to block Pinterest crawler and prevent saves to Pinterest from your site.
Fix Windows 10 Update errors(1909 to 20H2/21H1)
How to update ASUS Motherboard BIOS(AI suite 3/EZ update/Asus Business Manager)
[XAMPP]How to stop all services (Apache, Mysql) and exit from control panel by just clicking a shortcut.