end

(PHP 3, PHP 4, PHP 5)

end --  將陣列的內定指標指向最後一個單元

說明

mixed end ( array &array )

end()array 的內定指標搬移到最後一個單元並返回其值。

例子 1. 簡單的 end() 例子

<?php
$fruits 
= array('apple','banana','cranberry');
echo 
end($fruits); // cranberry
?>

參見 current()each()prev()next()reset()