← All built-ins / range()
range()
range(int $start, int $end): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $start | int | first value |
| $end | int | last value (inclusive) |
Return value
List of integers from $start to $end; counts down when $end < $start.
Example
echo implode(",", range(1, 5)), "
";
echo implode(",", range(3, 1)), "
";1,2,3,4,5 3,2,1