How to retrieve the last element in an array using php

  • 0

Using end() function we can retrieve the end index value in an array:

$endvalue= end($sample_array);

echo $endvalue;

Using end() function we can retrieve the end index value in an array: $endvalue= end($sample_array); echo $endvalue;

Using end() function we can retrieve the end index value in an array: $endvalue= end($sample_array); echo $endvalue;