mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
3c61250127
commit
4396c48294
1 changed files with 17 additions and 1 deletions
|
@ -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>,
|
||||
|
|
Loading…
Reference in a new issue