There is an array of this type: kint

I am trying to extract the values, but it does not work:

$i=0; foreach ($department as $drow){ d($drow[$i]['departmentID']); $i++; } 

    1 answer 1

    In the $drow variable, you have an array with the key departmentID , and at each iteration the value in this array will be updated:

     $department = [ ['departmentID' => 1], ['departmentID' => 2], ['departmentID' => 3], ['departmentID' => 4], ['departmentID' => 5] ]; foreach ($department as $drow){ echo $drow['departmentID'] . '<br>'; }