I've a JSON file that I'm trying to decode in PHP. This seems to work just fine when I do it on my web-server, but when trying on my local server, using the same exact file, I get NULL back. Other files are decoded just fine across both servers, so I'm really clueless why this specific file is not.
The JSON file could be found here: http://boghdady.com/samsung_Page_1_Results.json
My webserver is on PHP v5.6 while the local one is on 7.2. I've verified that the file syntax is fine, using https://www.freeformatter.com/json-validator.html
Echoing json_last_error on my local server outputs 10. I've tried all sorts of functions to convert the string to UTF-8 ahead of doing the json_decode, but results remain NULL. This is even though the file is originally in UTF-8 anyways.
Could anybody please help with this? As it is really driving me nuts.
Update 1, regarding the proposed solution from the other similar question: I've tried applying the fix indicated in json_decode produces error "Single unpaired UTF-16 surrogate in unicode escape" and returns null However, the eval() there lead to even more problems. Some of the text within the JSON string was considered as a variable by PHP, and thus it failed. Some examples of the errors received:
<b>Notice</b>: Undefined variable: GSI_TCPIP_IP_ADDR in <b>C:\Users\boghdady\Desktop\Server\Shodan\include\functions.php(73) : eval()'d code</b> on line <b>1</b><br />
<br />
<b>Notice</b>: Undefined variable: O in <b>C:\Users\boghdady\Desktop\Server\Shodan\include\functions.php(73) : eval()'d code</b> on line <b>1</b><br />
<br />
Is it possible to explain to me the issue within the JSON file in more details? I could write a function to fix it if I understand what it is.