diff --git a/functions/array.xml b/functions/array.xml index 0f55396bf4..4b7adc63f5 100644 --- a/functions/array.xml +++ b/functions/array.xml @@ -15,8 +15,8 @@ See also is_array, explode, - implode, split - and join. + implode, split + and join. @@ -50,12 +50,12 @@ - Syntax "index => values", separated by commas, define index - and values. index may be of type string or numeric. When index is - omitted, a integer index is automatically generated, starting - at 0. If index is an integer, next generated index will - be the biggest integer index + 1. Note that when two identical - index are defined, the last overwrite the first. + Syntax "index => values", separated by commas, define index + and values. index may be of type string or numeric. When index is + omitted, a integer index is automatically generated, starting + at 0. If index is an integer, next generated index will + be the biggest integer index + 1. Note that when two identical + index are defined, the last overwrite the first. The following example demonstrates how to create a @@ -83,6 +83,7 @@ print_r($array); which will display : + Array ( [0] => 1 @@ -93,6 +94,7 @@ Array [8] => 1 [9] => 19 ) + Note that index '3' is defined twice, and keep its final value of 13. Index 4 is defined after index 8, and next generated index (value 19) @@ -103,18 +105,20 @@ Array 1-based index with <function>Array</function> - $firstquarter = array(1 => 'January', 'February', 'March'); - print_r($firstquarter); + $firstquarter = array(1 => 'January', 'February', 'March'); + print_r($firstquarter); which will display : + Array ( - [1] => 'January' - [2] => 'February' - [3] => 'March' + [1] => 'January' + [2] => 'February' + [3] => 'March' ) +