note 47797 deleted from function.range by nlopess
| From: | nlopess@php.net | Date: | Tue, 30 Nov 2004 18:07:35 +0000 |
| Subject: | note 47797 deleted from function.range by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81194@lists.php.net to get a copy of this message | ||
Note Submitter: Forrester00 at gmail dot com
----
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.