hi.. is there any thing like End of File ..which i could use in array to go upto the last record of array as i don't know the number of elements in a array which are comming from a data base query thanks
$array=array("1","2","3","4"); echo $array[count($array)-1];
you have just got the last array 🙂
An associative array? Use bernouli's suggestion on array_values($array), rather than array itself. Or my one-line solution:
$last=$array[array_pop(array_keys($array))];