mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Link to the array type docs, added php tags in examples, and see also foreach.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@129441 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
5fee473d55
commit
1b0f444c3a
1 changed files with 14 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/array.xml, last change in rev 1.110 -->
|
||||
<refentry id="function.array">
|
||||
<refnamediv>
|
||||
|
@ -16,7 +16,9 @@
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
Returns an array of the parameters. The parameters can be given
|
||||
an index with the <literal>=></literal> operator.
|
||||
an index with the <literal>=></literal> operator. Read the section
|
||||
on the <link linkend="language.types.array">array type</link> for more
|
||||
information on what an array is.
|
||||
</para>
|
||||
<para>
|
||||
<note>
|
||||
|
@ -43,11 +45,13 @@
|
|||
<title><function>array</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$fruits = array (
|
||||
"fruits" => array ("a"=>"orange", "b"=>"banana", "c"=>"apple"),
|
||||
"numbers" => array (1, 2, 3, 4, 5, 6),
|
||||
"holes" => array ("first", 5 => "second", "third")
|
||||
);
|
||||
)
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@ -57,8 +61,10 @@ $fruits = array (
|
|||
<title>Automatic index with <function>array</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$array = array( 1, 1, 1, 1, 1, 8=>1, 4=>1, 19, 3=>13);
|
||||
print_r($array);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
|
@ -89,8 +95,10 @@ Array
|
|||
<title>1-based index with <function>array</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$firstquarter = array(1 => 'January', 'February', 'March');
|
||||
print_r($firstquarter);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
|
@ -110,7 +118,9 @@ Array
|
|||
</para>
|
||||
<para>
|
||||
See also <function>array_pad</function>,
|
||||
<function>list</function>, and <function>range</function>.
|
||||
<function>list</function>,
|
||||
<link linkend="control-structures.foreach">foreach</link>, and
|
||||
<function>range</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue