I want to encode some facebook data in a json, but if I do, for example
$likes = idx($facebook->api('/me/likes?limit=5000'), 'data', array());
fwrite($fileout,json_encode($likes));
$friends = idx($facebook->api('/me/friends?limit=5000'), 'data', array());
fwrite($fileout,json_encode($friends));
Now the problem with that is that it will produce a invalid json. They will both produce an entire json, with '[' and ']', however a valid json should only have one of each bracket in the entire file
Can you please advise me how should I deal with this?