mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- New example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@265668 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
fac021dd65
commit
9c862a24c1
1 changed files with 29 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue