SHARE
TWEET

Untitled

a guest Jun 19th, 2019 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $array1 = [
  2.     {
  3.         "id": 275692738,
  4.         "name": "Dispositivo 2 test"
  5.         "lastSeenAt": "Last seen:  2019-05-09"
  6.     },
  7.     {
  8.         "id": 275689630,
  9.         "name": "ONEPLUS A5000",
  10.         "lastSeenAt": "Last seen:  2019-05-09"
  11.     },
  12.     {
  13.         "id": 275690721,
  14.         "name": "herr",
  15.         "lastSeenAt": "Last seen:  2019-05-09"
  16.     },
  17.     {
  18.         "id": 275309414,
  19.         "name": "Firefox",
  20.         "lastSeenAt": "Last seen:  2019-05-08"
  21.     },
  22.     {
  23.         "id": 275366399,
  24.         "name": "Android Panel",
  25.         "lastSeenAt": "Last seen:  2019-05-07"
  26.     }
  27. ];
  28.  
  29. $array2 = [
  30.     {
  31.         "id": 275689630,
  32.         "name": "ONEPLUS A5000",
  33.         "lastSeenAt": "Last seen:  2019-05-09"
  34.     },
  35.     {
  36.         "id": 275690721,
  37.         "name": "herr",
  38.         "lastSeenAt": "Last seen:  2019-05-09"
  39.     }
  40. ];
  41.      
  42. foreach($array1 as $obj){
  43.  
  44.    foreach ($array2 as $obj2) {
  45.  
  46.        if ($obj2->id != $obj1->id) {
  47.  
  48.            echo obj1->id
  49.  
  50.       }    
  51.  
  52.    }
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top