note 47797 added to function.range
| From: | Forrester00 at gmail dot com | Date: | Tue, 30 Nov 2004 17:41:33 +0000 |
| Subject: | note 47797 added to function.range | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81191@lists.php.net to get a copy of this message | ||
To don wilson at gmail dot com:
<?php
// range() limitation for PHP <5.0.0
function myRange($num1, $num2, $step=1)
{
for($i = $num1; $i <= $num2; $i += $step)
{
$temp[] = $i;
}
return $temp;
}
?>
While this maybe "nicer" version of my code and has less lines of code, it lacks a
termendous amount of functionality (namely accounting for alphabet ranges).
j dot gizmo at aon dot at's function works very well.
Please test your functions before posting them, 2 people have e-mailed me about your comment, this
is the only reason why I even looked back here.
----
Manual Page -- http://www.php.net/manual/en/function.range.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47797
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47797&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47797&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47797&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47797&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47797&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47797&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47797&report=yes
Search -- http://master.php.net/manage/user-notes.php