title: in foreach, isLastItem() exists?
body: <p>Using a regular for loop, it's possible to comapred the current index with the last to tell if I'm in the last iteration of the loop. Is there a similar thing when using <code>foreach</code>? I mean something like this. </p>
  
  <pre><code>foreach($array as $item){
    //do stuff
    //then check if we're in the last iteration of the loop
    $last_iteration = islast(); //boolean true/false
  }
  </code></pre>
  
  <p>If not, is there at least a way to know the current index of the current iteration like <code>$iteration = 5</code>, so I can manually compare it to the length of the <code>$array</code>?</p>