Page 1 of 1

Looking for an alternative to the range() function

Posted: Fri Feb 13, 2004 11:21 am
by trantron
Looking for an alternative to the range() function

It is not working on an older version of PHP that I am stuck using.

According to the PHP manual:

Note: Prior to PHP version 4.1.0, range() only generated incrementing integer arrays. Support for character sequences and decrementing arrays was added in 4.1.0. Character sequence values are limited to a length of one. If a length greater than one is entered, only the first character is used.

If you know of a way of getting the same result as this function, I would really appreciate your help.

Posted: Fri Feb 13, 2004 12:20 pm
by twigletmac
Could you explain what kind of range you are looking for - it would make it easier to come up with a solution for your problem.

Mac

Posted: Fri Feb 13, 2004 2:56 pm
by trantron
I need to replace

range($min, $max);

for exmple: 1980-1984
$min= 1980
$max=1984

should return : 1980, 1981,1982,1983,1984

Posted: Sat Feb 14, 2004 12:37 pm
by Weirdan
hm... to me it seems like 'incrementing integer array'.....