title: Error when parsing FedEx Multidimensional Arrays with N-Level in Laravel
body: <p>FedEx web services return the following multidimensional array:</p>
  
  <pre><code>array(2) {
    ["Meta"]=&gt;
    array(2) {
      ["Code"]=&gt;
      int(200)
      ["ErrorMessage"]=&gt;
      string(0) ""
    }
    ["Data"]=&gt;
    array(6) {
      ["Errors"]=&gt;
      array(0) {
      }
      ["ShipmentId"]=&gt;
      string(12) "801000933796"
      ["Destination"]=&gt;
      array(6) {
        ["Addr1"]=&gt;
        NULL
        ["Addr2"]=&gt;
        NULL
        ["City"]=&gt;
        string(10) "PARSIPPANY"
        ["State"]=&gt;
        string(2) "NJ"
        ["PostalCode"]=&gt;
        NULL
        ["Country"]=&gt;
        string(2) "US"
      }
      ["EstimatedDelivery"]=&gt;
      string(0) ""
      ["DeliveredTime"]=&gt;
      string(25) ""
      ["Packages"]=&gt;
      array(1) {
        [0]=&gt;
        array(2) {
          ["TrackingNumber"]=&gt;
          string(12) "xxsssdfsds"
          ["Activity"]=&gt;
          array(19) {
            [0]=&gt;
            array(8) {
              ["Description"]=&gt;
              string(9) "Delivered"
              ["Location"]=&gt;
              array(4) {
                ["City"]=&gt;
                string(10) "PARSIPPANY"
                ["State"]=&gt;
                string(2) "NJ"
                ["PostalCode"]=&gt;
                string(5) "07054"
                ["Country"]=&gt;
                string(2) "US"
              }
              ["Time"]=&gt;
              string(25) "2019-07-08T09:31:00-04:00"
              ["StatusCode"]=&gt;
              string(2) "DL"
              ["StatusTypeCode"]=&gt;
              NULL
              ["StatusDescription"]=&gt;
              string(9) "Delivered"
              ["Signatory"]=&gt;
              string(7) "name"
              ["ProofOfDelivery"]=&gt;
  </code></pre>
  
  <p>Working with Laravel PHP Everything works ok extracting single line values, but I cannot find the way to extract N-Level values like the one displayed inside [Packages]</p>
  
  <p>I tried the following on controller:</p>
  
  <pre><code>        $events['Description'] = $response['Data']['Packages']['Activity']['Description'];
          $events['City'] = $response['Data']['Packages']['Activity']['Location']['City'];
          $events['State'] = $response['Data']['Packages']['Activity']['Location']['State'];
          $events['Country'] = $response['Data']['Packages']['Activity']['Location']['Country'];
          $events['Time'] = $response['Data']['Packages']['Activity']['Time'];
          $events['StatusCode'] = $response['Data']['Packages']['Activity']['StatusCode'];
          $events['StatusTypeCode'] = $response['Data']['Packages']['Activity']['StatusTypeCode'];
          $events['StatusDescription'] = $response['Data']['Packages']['Activity']['StatusDescription'];
          $events['Signatory'] = $response['Data']['Packages']['Activity']['Signatory'];
          $events = array();
          foreach($response['Data']['Packages'] as $data)
          {
              $events[] = $data;
          }
      }
  
      return view('ship2b/trackresults', compact('$events'));
  </code></pre>
  
  <p>and the view:</p>
  
  <pre><code>@foreach ($data as $row)
  
      {{ $row['Activity']['Location']['City'] }}
      @endforeach
  </code></pre>
  
  <p>But the system displays error at controller in every </p>
  
  <pre><code>$response['Data']['Packages']['Activity'];
  </code></pre>
  
  <p>of course it works if I placed [0] eg:</p>
  
  <p>$response['Data']['Packages'][0]['Activity']['Description'];</p>
  
  <p>but it will not iterate through ['Packages'] and only will retrieve first ['Activity'] value.</p>
  
  <p>My desire output would be something like:</p>
  
  <pre><code>@foreach ($data as $row)
  
      {{ $row-&gt;Activity-&gt;Location-&gt;City }}
      {{ $row-&gt;Activity-&gt;Location-&gt;State }}
      {{ $row-&gt;Activity-&gt;Location-&gt;Country }}
  
      @endforeach
  </code></pre>
  
  <p>for each Package Activity information. Thanks!</p>