title: PHP Get a specific property from an array of objects with different array count
body: <p>I am in a confusing situation right now. </p>
  
  <p>So, I have an array of objects </p>
  
  <pre><code>array:3 [▼
    0 =&gt; array:5 [▶]
    1 =&gt; array:2 [▶]
    2 =&gt; array:10 [▶]
  ]
  </code></pre>
  
  <p>Each array items contains another array which will have objects</p>
  
  <pre><code>array:3 [▼
    0 =&gt; array:5 [▼
      0 =&gt; {#215 ▼
        +"DefaultTimeLength": 40
        +"ProgramID": 4
        +"NumDeducted": 1
        +"ID": 245
        +"Name": "30-Swedish-Massage"
      }
      1 =&gt; {#216 ▼
        +"DefaultTimeLength": 70
        +"ProgramID": 4
        +"NumDeducted": 1
        +"ID": 246
        +"Name": "60-Swedish-Massage"
      }
      2 =&gt; {#217 ▶}
      3 =&gt; {#218 ▶}
      4 =&gt; {#219 ▶}
    ]
    1 =&gt; array:2 [▶]
    2 =&gt; array:10 [▶]
  ]
  </code></pre>
  
  <p>What I want to achieve is, I want to get the 'ID' and 'Name' as an array for every array of objects from this array. Since, every array inside the main array have different counts, I cannot use a FOR loop, to get the required data. 
  Any ideas? </p>