Question: I have an array of objects, any array in php.
How do i skip the last element in the foreach iteration?

Answer: 
What you are trying to do will defeat the purpose of foreach loop. It is meant to loop through the entire array and make our job easy. 

for ex: You can get the array size using **COUNT** function in php and then can use for loop and set the limit to arraysize-2, so the last array will be omitted
```
$count = count($array);
$i=0;
foreach ($arr as &$value) 
{
    $i++;
    if($i==($count-1))
    {
      echo 'skip';
    }
    else
    {
      echo $value;
    }
}

```