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