The question is simple. I have a foreach loop in my code:
foreach
foreach($array as $element) { //code }
In this loop, I want to r
To find the last item, I find this piece of code works every time:
foreach( $items as $item ) { if( !next( $items ) ) { echo 'Last Item'; } }