why use current() function:
current() returns the value of the current element in an array:
Syntax of current() function:
current(array)
why use end() function:
end() returns the value of the last element in an array:
Syntax of end() function:
end(array)
You can take reference form below example to use of current() function and end() function.
<?php
//people is a varible name
$people = array("ben", "mac", "jorden");
//call the current()
echo current($people) . "<br>";
//call the end()
echo end($people);
?>
output will come following:
1-when call current() then,
output will come:
ben
2-when call end() then,
output wil come:
jorden
0 Comment(s)