title: getting values from std class objects and arrays in PHP
body: <p>I'm trying to get the values from this type of array by using PHP. how to access the subject names from this array.?? can I get those values without using 2 <code>foreach</code>'s ??
  note: subject array count are not fixed</p>
  
  <pre><code> stdClass Object
  (
      [Examination] =&gt; Array
          (
              [0] =&gt; stdClass Object
                  (
                      [ActivityID] =&gt; 734
                      [ActivityName] =&gt; EXECUTIVE LEVEL - II
                      [CloseDate] =&gt; 2017-10-02T00:00:00
                      [ExamSubjects] =&gt; stdClass Object
                          (
                              [ExamSubject] =&gt; Array
                                  (
                                      [0] =&gt; stdClass Object
                                          (
                                              [SubjectCode] =&gt; KE-2
                                              [SubjectID] =&gt; 001013
                                              [SubjectName] =&gt; KE2-Management Accounting Information
                                          )
  
                                      [1] =&gt; stdClass Object
                                          (
                                              [SubjectCode] =&gt; KE-3-LF
                                              [SubjectID] =&gt; 001016
                                              [SubjectName] =&gt; KE3B-Fundamentals of Law
                                          )
  
                                  )
  
                          )
  
                      [OpenDate] =&gt; 2017-05-18T00:00:00
                      [SessionID] =&gt; 000091
                      [SessionName] =&gt; TestOnlineApp
                  )
  
              [1] =&gt; stdClass Object
                  (
                      [ActivityID] =&gt; 735
                      [ActivityName] =&gt; EXECUTIVE LEVEL - I &amp; II
                      [CloseDate] =&gt; 2017-10-02T00:00:00
                      [ExamSubjects] =&gt; stdClass Object
                          (
                              [ExamSubject] =&gt; Array
                                  (
                                      [0] =&gt; stdClass Object
                                          (
                                              [SubjectCode] =&gt; KE-1
                                              [SubjectID] =&gt; 001012
                                              [SubjectName] =&gt; KE1-Financial Accounting &amp; Reporting Fundamentals
                                          )
  
                                      [1] =&gt; stdClass Object
                                          (
                                              [SubjectCode] =&gt; KE-2
                                              [SubjectID] =&gt; 001013
                                              [SubjectName] =&gt; KE2-Management Accounting Information
                                          )
  
  
                                  )
  
                          )
  
                      [OpenDate] =&gt; 2017-05-18T00:00:00
                      [SessionID] =&gt; 000091
                      [SessionName] =&gt; TestOnlineApp
                  )
  
          )
  
  )
  </code></pre>