1<?php
2
3$source_array = ['key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'];
4
5$result = end($source_array);
6
7echo "Last element: ".$result;
8
9?>
1<?php
2
3// input array
4$arr = array('Ram', 'Shita', 'Geeta');
5
6// end function print the last
7// element of the array.
8echo end($arr);
9
10?>
11