end() function: The
end() function points the pointer inside the array to the last element, and returns the value of the element if successful;
for example:
<code><span>$people</span> = <span>array</span>(<span>"Peter"</span>, <span>"Joe"</span>, <span>"Glenn"</span>, <span>"Cleveland"</span>); <span>echo</span> end(<span>$people</span>);</code>
output: Cleveland
current () function:
current() function returns the current element (unit) in the array.
Each array has an internal pointer that points to its "current" element, initially pointing to the first element inserted into the array.**Note: If there is an empty element, or the element has no value, this function also returns FALSE.
Tip: This function does not move the internal pointer. To do this, use the next() and prev() functions. **
For example:
<code><span>$people</span> = <span>array</span>(<span>"Peter"</span>, <span>"Joe"</span>, <span>"Glenn"</span>, <span>"Cleveland"</span>); <span>echo</span> current(<span>$people</span>);</code>
output: Peter
The above introduces the PHP end function and current function, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.