title: json calling other json using php
body: <p>I need your help..I would like to call a json value using a json value...</p>
  
  <p>here's my sample json...</p>
  
  <p><strong>first json:</strong></p>
  
  <pre><code>{
    "first_name": "Richard Catibog",
    "last_name": "",
    "display_name": "Richard Catibog ",
    "roles": {
      "owner": false,
      "administrator": true
    },
    "login_count": 108,
    "enabled": true,
    "departments": [
      1817719575,
      1817719887,
      1817722991
    ],
    "id": 4142095,
    "last_login": "2017-07-12T10:03:57Z",
    "create_date": "2017-04-28T12:09:57Z",
    "email": "richard.catibog+21757948948@51talk.com"
  },
  {
    "first_name": "Rovi Cruz",
    "last_name": "",
    "display_name": "Rovi Roy Cruz ",
    "roles": {
      "owner": false,
      "administrator": true
    },
    "login_count": 98,
    "enabled": true,
    "departments": [
      1817719575,
      1817719887,
      1817722991
    ],
    "id": 4225009,
    "last_login": "2017-07-13T00:37:27Z",
    "create_date": "2017-06-05T06:15:49Z",
    "email": "rovi.cruz+21821290968@51talk.com"
  }
  </code></pre>
  
  <p>Second json:</p>
  
  <pre><code>[
    {
      "description": "Fees Support for American Academy",
      "settings": {
  
      },
      "enabled": false,
      "id": 1817719575,
      "name": "AA Fees Support [L2]"
    },
    {
      "description": "American Academy",
      "settings": {
  
      },
      "enabled": true,
      "id": 1817722991,
      "name": "Lesson and Fee Support"
    },
    {
      "description": "Technical Support",
      "settings": {
  
      },
      "enabled": true,
      "id": 1817719887,
      "name": "Technical Support"
    }
  ]
  </code></pre>
  
  <p>I would like to call the id on the second and echo the names using the departments id list on first json...</p>
  
  <p>here's what i get...
  <a href="https://i.stack.imgur.com/zCekX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zCekX.png" alt="enter image description here"></a>
  but the result that i want to see is AA Fees Support [L2], Lesson and Fee Support and Technical Support...</p>
  
  <p>thank you, hope you can help me...</p>