|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-08 12:55 UTC] moriyoshi@php.net
[2003-02-08 12:56 UTC] moriyoshi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 23 22:00:02 2025 UTC |
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.