📅  最后修改于: 2022-03-11 14:54:45.689000             🧑  作者: Mango
foreach($array as $key => $element) {
if ($key === array_key_first($array))
echo 'FIRST ELEMENT!';
if ($key === array_key_last($array))
echo 'LAST ELEMENT!';
}