I\'m using FQL to retrieve a list of users from Facebook. For consistency I get the result as JSON. This causes a problem - since the returned JSON encodes the user IDs as n
I use this and it works almost great.
json_decode(preg_replace('/("\w+"):(\d+)/', '\\1:"\\2"', $jsonString), true)
The json breaks when there is geo data included, eg. {"lat":54.2341} results in "lat":"54".2341
{"lat":54.2341}
"lat":"54".2341
Solution:
$json = preg_replace('/("\w+"):(\d+)(.\d+)?/', '\\1:"\\2\\3"', $json);