Function end () usage of php to access the last element of the array
This article mainly introduces the end () usage of the function for php to access the last element of the array. The example analyzes the skills of the end function in php to access the array elements, which is very useful, for more information, see
This example describes how to use the end () function of php to access the last element of the array. Share it with you for your reference. The specific analysis is as follows:
The end () function is used in PHP to retrieve the last element in the array. The end () function requires an array as its unique parameter and returns the element value of the last element of the given array.
?
1 2 |
$ Users = array ("baidu.com", "haosou.com", "sina.com", "jb51.net "); Print end ($ users ); |
The above code returns: jb51.net
I hope this article will help you with php programming.