// How to determine the first and last iteration in a foreach loop?
// stackoverflow.com/questions/1070244/how-to-determine-the-first-and-last-iteration-in-a-foreach-loop
reset($array);
$first = key($array);
foreach($array as $key => $element) {
if ($key === $first)
echo 'FIRST ELEMENT!';
}