mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix examples to print the output and fix output
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@228472 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
afa227117b
commit
e44970bf48
7 changed files with 19 additions and 28 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<refentry id="function.array-intersect-assoc">
|
||||
<refnamediv>
|
||||
<refname>array_intersect_assoc</refname>
|
||||
|
@ -28,12 +28,11 @@
|
|||
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
|
||||
$array2 = array("a" => "green", "yellow", "red");
|
||||
$result_array = array_intersect_assoc($array1, $array2);
|
||||
print_r($result_array);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
$result_array will look like:
|
||||
</para>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.array-intersect-ukey">
|
||||
<refnamediv>
|
||||
<refname>array_intersect_ukey</refname>
|
||||
|
@ -56,7 +56,7 @@ array(2) {
|
|||
int(1)
|
||||
["green"]=>
|
||||
int(3)
|
||||
})
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- splitted from ./en/functions/array.xml, last change in rev 1.14 -->
|
||||
<refentry id="function.array-intersect">
|
||||
<refnamediv>
|
||||
|
@ -29,12 +29,11 @@
|
|||
$array1 = array("a" => "green", "red", "blue");
|
||||
$array2 = array("b" => "green", "yellow", "red");
|
||||
$result = array_intersect($array1, $array2);
|
||||
print_r($result);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This makes <varname>$result</varname> have
|
||||
</para>
|
||||
&example.outputs;
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
Array
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/array.xml, last change in rev 1.12 -->
|
||||
<refentry id="function.array-merge-recursive">
|
||||
<refnamediv>
|
||||
|
@ -35,12 +35,11 @@
|
|||
$ar1 = array("color" => array("favorite" => "red"), 5);
|
||||
$ar2 = array(10, "color" => array("favorite" => "green", "blue"));
|
||||
$result = array_merge_recursive($ar1, $ar2);
|
||||
print_r($result);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The <literal>$result</literal> will be:
|
||||
</para>
|
||||
&example.outputs;
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
Array
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- $Revision: 1.14 $ -->
|
||||
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.array-push">
|
||||
<refnamediv>
|
||||
|
@ -44,10 +44,7 @@ print_r($stack);
|
|||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This example would result in <varname>$stack</varname> having
|
||||
the following elements:
|
||||
</para>
|
||||
&example.outputs;
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
Array
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.array-unshift">
|
||||
<refnamediv>
|
||||
|
@ -33,13 +33,11 @@
|
|||
<?php
|
||||
$queue = array("orange", "banana");
|
||||
array_unshift($queue, "apple", "raspberry");
|
||||
print_r($queue);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This would result in <varname>$queue</varname> having the
|
||||
following elements:
|
||||
</para>
|
||||
&example.ouputs;
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
Array
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.compact">
|
||||
<refnamediv>
|
||||
|
@ -54,12 +54,11 @@ $event = "SIGGRAPH";
|
|||
$location_vars = array("city", "state");
|
||||
|
||||
$result = compact("event", "nothing_here", $location_vars);
|
||||
print_r($result);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
After this, <varname>$result</varname> will be:
|
||||
</para>
|
||||
&example.ouputs;
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
Array
|
||||
|
|
Loading…
Reference in a new issue