- New example

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@265668 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Felipe Pena 2008-08-30 14:23:24 +00:00
parent fac021dd65
commit 9c862a24c1

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.20 $ -->
<!-- $Revision: 1.21 $ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.array-map">
<refnamediv>
<refname>array_map</refname>
@ -98,6 +98,34 @@ Array
[3] => 64
[4] => 125
)
]]>
</screen>
</example>
<example>
<title><function>array_map</function> using lambda function (as of PHP 5.3.0)</title>
<programlisting role="php">
<![CDATA[
<?php
/* As of PHP 5.3.0 */
$func = function($value) { return $value * 2; };
print_r(array_map($func, range(1, 5)));
?>
]]>
</programlisting>
<screen>
<![CDATA[
Array
(
[0] => 2
[1] => 4
[2] => 6
[3] => 8
[4] => 10
)
]]>
</screen>
</example>