If you don't want to delete the last array entry with pop, you could skip it like this
$array = array('v1','v2','v3',...)
$counter = 1;
foreach($array as $value)
{
//do your thing in loop
if($counter == count($array)) continue; // this will skip to next iteration if last element encountered.
$counter++;
}