Hi,
I guess this is quite a silly question for many of you guys, but do you know I could say....have a variable = 5 and echo out the numbers 1,2,3,4,5 from it?
3 -> 1,2,3 8 -> 1,2,3,4,5,6,7,8
yep. just like that. thanks
Just use a for loop, like this:
<?PHP $var = 8; for ($i=0; $i<=$var; $i++) { echo $i; } ?>
Or, use this edit if you want the commas in there....
<?PHP $var = 8; for ($i=0; $i<=$var; $i++) { if ($i != $var) { echo ("$i,"); } else { echo ("$i"); } } ?>