goba Sat Nov 10 17:11:40 2001 EDT
Modified files:
/phpdoc/en/functions array.xml
Log:
Expanding example of array_chunk
Index: phpdoc/en/functions/array.xml
diff -u phpdoc/en/functions/array.xml:1.111 phpdoc/en/functions/array.xml:1.112
--- phpdoc/en/functions/array.xml:1.111 Sat Nov 10 16:49:32 2001
+++ phpdoc/en/functions/array.xml Sat Nov 10 17:11:39 2001
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.111 $ -->
+<!-- $Revision: 1.112 $ -->
<reference id="ref.array">
<title>Array Functions</title>
<titleabbrev>Arrays</titleabbrev>
@@ -169,17 +169,55 @@
<title><function>array_chunk</function> example</title>
<programlisting role="php">
$input_array = array('a', 'b', 'c', 'd', 'e');
-$output_array = array_chunk($input_array, 2);
-/*
- the structure of $output_array will be:
- array(
- array('a', 'b'),
- array('c', 'd'),
- array('e')
- )
-*/
+print_r(array_chunk($input_array, 2));
+print_r(array_chunk($input_array, 2, TRUE));
</programlisting>
</example>
+ The printout of the above program will be:
+ <informalexample>
+ <programlisting>
+Array
+(
+ [0] => Array
+ (
+ [0] => a
+ [1] => b
+ )
+
+ [1] => Array
+ (
+ [0] => c
+ [1] => d
+ )
+
+ [2] => Array
+ (
+ [0] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [0] => a
+ [1] => b
+ )
+
+ [1] => Array
+ (
+ [2] => c
+ [3] => d
+ )
+
+ [2] => Array
+ (
+ [4] => e
+ )
+
+)
+ </programlisting>
+ </informalexample>
</para>
</refsect1>
</refentry>