the last.fm API is returning a JSON string which I convert to an array using
json_decode($response, ($returnType == 'array'));
When the response is dumped it gives me the following json string:
{"session":{"name":"turncoat9","key":"b311abDee2d34e07541eeeefted2bad","subscriber":"0"}} 1
(note the 1 in the end)
Because of this extra character the json string cannot be converted to an associative array, hence my problem.
I found a few discussions which state that the 1 is a BOM (byte order mask) character, but all solutions provided does not work with my json string.
What is this character? Why is it there and why does this not happen when I develop locally? What is the solution for this?
Tried this on two different webservers, gave the same result