Return to Snippet

Revision: 55393
at February 5, 2012 05:43 by pruntrut


Initial Code
<?php
$array = array('apples','bananas','cranberries','durians');
$last_item = end($array);

foreach($array as $item) {
  if ($item == $last_item) {
    print "I like to eat " . $item;
  }
}
?>

Initial URL

                                

Initial Description

                                

Initial Title
Last Item Foreach

Initial Tags
php

Initial Language
PHP