I am facing a weird problem with file_get_contents and decoding to json the result. I have to tell you that this code was fully functional in other server.
The json is simply invalid.
In front of the first opening curly braces there is the following content (hex encoded) ef bb bf ef bb bf
It is the utf8 bom.
There is a question related to deal with exactly that, so I will not cover it here. Read up here:
How to remove %EF%BB%BF in a PHP string
and another one dealing specifically with json here:
Convert UTF-8 with BOM to UTF-8 with no BOM in Python
Try to give JSON URL
in the http://jsonlint.com/ and than copy the response and paste it in a file with BOM
disabled you will notice that there is a strange small line in the beginning before the opening {
bracket which is causing the issues