cvs: phpdoc /en/reference/array/functions range.xml

From: Date: Thu, 14 Nov 2002 05:57:59 +0000
Subject: cvs: phpdoc /en/reference/array/functions range.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969349641@lists.php.net to get a copy of this message
jon Thu Nov 14 00:57:59 2002 EDT Modified files: /phpdoc/en/reference/array/functions range.xml Log: Updating the range() documentation to include the new "step" parameter. Index: phpdoc/en/reference/array/functions/range.xml diff -u phpdoc/en/reference/array/functions/range.xml:1.4 phpdoc/en/reference/array/functions/range.xml:1.5 --- phpdoc/en/reference/array/functions/range.xml:1.4 Sun May 12 04:19:28 2002 +++ phpdoc/en/reference/array/functions/range.xml Thu Nov 14 00:57:58 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.range"> <refnamediv> @@ -14,12 +14,19 @@ <type>array</type><methodname>range</methodname> <methodparam><type>mixed</type><parameter>low</parameter></methodparam> <methodparam><type>mixed</type><parameter>high</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>step</parameter></methodparam> </methodsynopsis> <para> <function>range</function> returns an array of elements from <parameter>low</parameter> to <parameter>high</parameter>, inclusive. If low > high, the sequence will be from high to low. </para> + <para> + If a <parameter>step</parameter> value is given, it will be used as the + increment between elements in the sequence. <parameter>step</parameter> + should be given as a positive number. If not specified, + <parameter>step</parameter> will default to 1. + </para> <example> <title><function>range</function> examples</title> <programlisting role="php"> @@ -27,6 +34,9 @@ foreach(range(0, 9) as $number) { echo $number; } +foreach(range(0, 100, 10) as $number) { + echo $number; +} foreach(range('a', 'z') as $letter) { echo $letter; } @@ -41,6 +51,7 @@ Prior to version 4.1.0 the <function>range</function> function only generated incrementing integer arrays. Support for character sequences and decrementing arrays was added in 4.1.0. + The <parameter>step</parameter> parameter was added in 4.4.0. </para> <example> <title>Simulating decrementing ranges and character sequences</title>

« previous php.doc (#969349641) next »