<?php $array = Array ( "states" => Array ( "" => "Select State", "1" => "Andaman and Nicobar (AN)", "2" => "Andhra Pradesh (AP)")); echo "<pre>"; print_r($array ); end($array['states']); // move the pointer to the end of the array $key = key($array['states']); // get the last key $value = $array['states'][$key]; //// get last value be key echo 'Last key '.$key.'and last value '. $value ; ?>
You have javascript disabled. You will not be able to edit any code.