Advertisement
Guest User

Untitled

a guest
Feb 25th, 2013
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1.     $json1 = '{"data": [{"category": "Games","id": "45345"}, {"category": "Music","id": "345345345"}, {"category": "Food","id": "1"}, {"category": "Pets","id": "13245345"}],"paging": {"next": "https://graph.facebook.com/1161990140/likes?limit=2&offset=2&__after_id=118243704898877"}}';
  2.     $json2 = '{"data":  {"something": "blah","posts":  [{"id": "34241","title": "orange"}],"items":  [{"id": "1","name": "orange"},{"id": "2","name": "dog"},{"id": "3","name": "cat"},{"id": "4","name": "apple"}]}}';
  3.  
  4.     $array1 = json_decode($json1, true);
  5.     $array2 = json_decode($json2, true);
  6.  
  7.     $result = array_diff($array1, $array2);
  8.  
  9.     var_dump($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement