英[end] 美[?nd]
n.End;<positive>result;termination;last part
vt.& vi.end,termination
Third person singular: ends Plural: ends Present participle: ending Past tense: ended Past participle: ended
php end() function syntax
Function: Point the internal pointer of the array to the last element and return the value of the element (if successful).
Syntax: end(array)
Parameters:
Parameter | Description |
array | Required. Specifies the array to use. |
Description: If successful, return the value of the last element in the array, if the array is empty, return FALSE.
php end() function example
<?php $people = array("西門", "滅絕", "無忌"); echo end($people); //指向最后一個元素 無忌 ?>
Run instance?
Click the "Run instance" button to view the online instance
Output:
無忌
<?php $people = array("peter", "無忌", "歐陽克"); echo end($people); //指向最后一個元素 歐陽克 ?>
Run Instance?
Click the "Run Instance" button to view the online instance
Output:
歐陽克