php get last two items in an array code example Example: php get second last element of array $array = array(5,6,70,10,36,2); echo $array[count($array) -2];