多级数组 - 好像我在圈子里走来走去?

This is an example of the array I am working with

array(7) 
{ 
    ["ClassId"]=> int(26) 
    ["ClassName"]=> string(9) "Candidate" 
    ["Data"]=> array(1) 
    { 
        [0]=> array(8) 
        { 
            ["AppDataId"]=> int(17736) 
            ["FirstName"]=> string(4) "hano" 
            ["LastName"]=> string(11) "steenhuizen" 
            ["CvTxtField"]=> string(4) "coal" 
            ["Telephone"]=> string(6) "2345§" 
            ["Email"]=> string(27) "hano11aaaaa@steenhuizen.com" 
            ["Abstract"]=> string(16) "hano steenhuizen" 
            ["TimeStamp"]=> string(22) "2017-09-05 06:08:41+02" 
        } 
    } 
    ["RowCount"]=> int(1) 
    ["PageNumber"]=> int(1) 
    ["PageSize"]=> int(100) 
    ["QueryTime"]=> string(6) "0.009s" 
}

For the life of me, I just cannot loop this with a basic PHP foreach loop? $objApi contains the array above

echo '<table>';
foreach($objApi as $value)
    {
            echo '<tr><td>' . $value['FirstName'] . '</td></tr>';
    }

echo '</table>

I would love to understand the workings of the array better as for some reason I just cannot get it right.

The arrays is a tree of values associated to a key, you can define the key and the values as you with, even, you can create a value of a array as another array. The only thing that you have to know is the structure that you array has, at the moment to iterate.

For you example code, if you want to iterate the data result of your query, this is the way:

foreach($row['Data'] as $row){
    foreach($row as $user){
        echo '<tr><td>'.$user['FirstName'].'</td></tr>';
    }
}

I access directly in the array key that has the values of your query

echo '<table>';
foreach($objApi['Data'] as $value)
{
        echo '<tr><td>' . $value['FirstName'] . '</td></tr>';
}

echo '</table>';

Do:

foreach($objApi as $value)
{
       print_r($value);
}

Then check if there is a need for another inside loop.

It seems that you might need:

    foreach($value["Data"] as $data)
    {
       print_r($data);
    }

Then you can use $data['FirstName']