reference/array/functions/array.xml
2e60c5134e7a847c99f81eb3f7ecee1f5efeeace
2e60c5134e7a847c99f81eb3f7ecee1f5efeeace
...
...
@@ -9,12 +9,12 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>array</type><methodname>array</methodname>
12
-
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
12
+
<methodparam rep="repeat"><type>mixed</type><parameter>values</parameter></methodparam>
13
13
</methodsynopsis>
14
14
<para>
15
15
Creates an array. Read the section on the
16
16
<link linkend="language.types.array">array type</link> for more information
17
-
on what an array is.
17
+
on what an array is, including details about the alternative bracket syntax (<literal>[]</literal>).
18
18
</para>
19
19
</refsect1>
20
20
<refsect1 role="parameters">
...
...
@@ -22,7 +22,7 @@
22
22
<para>
23
23
<variablelist>
24
24
<varlistentry>
25
-
<term><parameter>...</parameter></term>
25
+
<term><parameter>values</parameter></term>
26
26
<listitem>
27
27
<para>
28
28
Syntax "index => values", separated by commas, define index
...
...
@@ -30,7 +30,7 @@
30
30
omitted, an integer index is automatically generated, starting
31
31
at 0. If index is an integer, next generated index will
32
32
be the biggest integer index + 1. Note that when two identical
33
-
index are defined, the last overwrite the first.
33
+
indices are defined, the last overwrites the first.
34
34
</para>
35
35
<para>
36
36
Having a trailing comma after the last defined array entry, while
...
...
@@ -67,6 +67,7 @@ $fruits = array (
67
67
"numbers" => array(1, 2, 3, 4, 5, 6),
68
68
"holes" => array("first", 5 => "second", "third")
69
69
);
70
+
print_r($fruits);
70
71
?>
71
72
]]>
72
73
</programlisting>
...
...
@@ -78,7 +79,7 @@ $fruits = array (
78
79
<programlisting role="php">
79
80
<![CDATA[
80
81
<?php
81
-
$array = array(1, 1, 1, 1, 1, 8 => 1, 4 => 1, 19, 3 => 13);
82
+
$array = array(1, 1, 1, 1, 1, 8 => 1, 4 => 1, 19, 3 => 13);
82
83
print_r($array);
83
84
?>
84
85
]]>
...
...
@@ -112,8 +113,8 @@ Array
112
113
<programlisting role="php">
113
114
<![CDATA[
114
115
<?php
115
-
$firstquarter = array(1 => 'January', 'February', 'March');
116
-
print_r($firstquarter);
116
+
$firstQuarter = array(1 => 'January', 'February', 'March');
117
+
print_r($firstQuarter);
117
118
?>
118
119
]]>
119
120
</programlisting>
...
...
@@ -138,10 +139,8 @@ Array
138
139
<programlisting role="php">
139
140
<![CDATA[
140
141
<?php
141
-
142
142
$foo = array('bar' => 'baz');
143
143
echo "Hello {$foo['bar']}!"; // Hello baz!
144
-
145
144
?>
146
145
]]>
147
146
</programlisting>
148
147