end(): Added a simple example using end()

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78724 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2002-04-18 23:29:24 +00:00
parent 3c61250127
commit 4396c48294

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
<refentry id="function.end">
<refnamediv>
@ -18,6 +18,22 @@
<function>end</function> advances <parameter>array</parameter>'s
internal pointer to the last element, and returns that element.
</para>
<para>
<example>
<title>A simple <function>end</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$fruits = array('apple','banana','cranberry');
print end($fruits); // cranberry
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>current</function>,
<function>each</function>,