I tried to have this multi-dimensional array on Quotes>Sections>Departments I have a problem with getting the first iteration of the foreach-ed
$Department->getActuals();
$actuals = array();
foreach($quotes as $quoteID => $Quotes) {
$invoiceTotal = $Quotes->getInvoicedValue();
if($invoiceTotal['Total'] > 0) {
$labourCost = 0;
$actualHours = 0;
$sections = $Quotes->getSections();
foreach ($sections as $Sections) {
$departments = $Sections->getDepartments();
foreach($departments as $Department) {
$actuals = $Department->getActuals(null, null, false);
Console::Log('actuals', $actuals);
}
}
}
}
Console::Log('actuals', $actuals);
How to get the first element result in Php using foreach?
Thank you in advance