I have below code. But I cannot understand what is meant by $seat_key => $seat
in foreach
. In other terms, I understand foreach ($seats as $seat)
, but not foreach ($seats as $seat_key => $seat)
foreach ($seats as $seat_key => $seat) {
$email_found = false;
foreach ($email_accounts as $key => $email_account) {
if (strtolower($email_account->email) == strtolower($seat->email) && empty($email_account->deactivated_since) && empty($email_account->flg_deleted)) {
unset($seats[$seat_key]);
unset($email_accounts[$key]);
$email_found = true;
if (isset($email_found_seats[$seat->email])) {
$email_duplicated_seats[] = $seat;
} else {
$email_found_seats[$seat->email] = $seat;
}
}
}
}