PHP - number: Generating a Number RangeTag: number, number range Category: PHP Applicationpost: 16 Mar 2008 read: 184 PHP Number tips - part 1: If you have two endpoints and want to generate a list of all the numbers between them, so you can use PHP's range( ) function such as:
The range( ) function accepts two arguments. There are a lower limit and an upper limit. Beside that, it returns an array containing all the integers between those limits and you can also create a number range that steps over particular number by passing the step value to the function as a third, optional argument.
A simple application of range( ) function is to print a multiplication table. Beneath, you can see a list illustrates how to do print a multiplication table, by generating all numbers between 1 and 10, then using the list to print a multiplication table for the number 5:
|
| | Give Your Opinion | Recommend |
|

