Created
December 10, 2009 12:49
-
-
Save dogmatic69/253310 to your computer and use it in GitHub Desktop.
needed for chart helper to generate ranges for x & y axyis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach(range('a', 'z') as $letter) { | |
echo $letter; | |
} | |
?> | |
This function will also work with numbers. This will print all the numbers from 1 to 12. | |
<?php | |
foreach(range(0, 12) as $number) { | |
echo $number; | |
} | |
?> | |
And if you are smart, and run PHP 5, you can even print every tenth number (0,10,20,30...) | |
<?php | |
foreach(range(0, 100, 10) as $number) { | |
echo $number; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment