php last item

$last_item = end($array);  //  point the end of array
$last_item = each($array); //  assign key and value of current pointer
reset($array);
foreach($array as $key => $value){
	if($value == $last_item['value'] && $key == $last_item['key']){
                // TODO
	}
}
Advertisements