Hi Reader's,
Welcome to FindNerd, today we are going to discuss about end() function.
The end() function is used for printing last element of an array.
It is advances array s internal pointer to the last element.
syntax of end() function
end(array)
array is required parameter
you can see bellow example:
<?php
//here define a variable of array
$data = array(
'Emp_name' => 'Roy',
'Emp_age' => 30,
'Emp_dep' => 'account',
);
//here call end() move the internal pointer to the end of the array
echo end($data);
?>
output will come following of above example
account
0 Comment(s)