mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
See also array_walk(); and some <?php ?> additions.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@103278 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
fd14b35700
commit
ddf7426cca
1 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/array.xml, last change in rev 1.62 -->
|
||||
<refentry id="function.array-map">
|
||||
<refnamediv>
|
||||
|
@ -30,6 +30,7 @@
|
|||
<title><function>array_map</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function cube($n) {
|
||||
return $n*$n*$n;
|
||||
}
|
||||
|
@ -37,6 +38,7 @@ function cube($n) {
|
|||
$a = array(1, 2, 3, 4, 5);
|
||||
$b = array_map("cube", $a);
|
||||
print_r($b);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
|
@ -61,6 +63,7 @@ Array
|
|||
<title><function>array_map</function> - using more arrays</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function show_Spanish($n, $m) {
|
||||
return "The number $n is called $m in Spanish";
|
||||
}
|
||||
|
@ -77,6 +80,7 @@ print_r($c);
|
|||
|
||||
$d = array_map("map_Spanish", $a , $b);
|
||||
print_r($d);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
|
@ -144,12 +148,14 @@ Array
|
|||
<title>Creating an array of arrays</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$a = array(1, 2, 3, 4, 5);
|
||||
$b = array("one", "two", "three", "four", "five");
|
||||
$c = array("uno", "dos", "tres", "cuatro", "cinco");
|
||||
|
||||
$d = array_map(null, $a, $b, $c);
|
||||
print_r($d);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@ -200,8 +206,9 @@ Array
|
|||
</screen>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>array_filter</function> and
|
||||
<function>array_reduce</function>.
|
||||
See also <function>array_filter</function>,
|
||||
<function>array_reduce</function>, and
|
||||
<function>array_walk</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue