#15920 [Opn->Csd]: range() with a step parameter
| From: | moriyoshi@php.net | Date: | Sat, 08 Feb 2003 18:55:31 +0000 |
| Subject: | #15920 [Opn->Csd]: range() with a step parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32508@lists.php.net to get a copy of this message | ||
ID: 15920
Updated by: moriyoshi@php.net
Reported By: pgerzson@freestart.hu
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 4.1.2
New Comment:
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
Previous Comments:
------------------------------------------------------------------------
[2002-03-06 20:54:25] pgerzson@freestart.hu
I think it would be useful in some situation if the range() function
can take a third optional parameter (called "step" or whatever you
want) which specifies the space between two consecutive elements in the
resulting array. For example:
$array = range(1, 5, 2); // array(1,3,5);
It might be always positive to understand its effect easily.
$array = range('Z', 'A', 3); // array('Z', 'W',
'T', 'Q', ...);
If the second boundary cannot be included regarding to the step
parameter, just simply leave it out:
$array = range(1, 6, 2); // array(1,3,5);
That's all.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15920&edit=1