Gen. partnerAlgotech

PHP function range()

Create an array containing a range of elements

|
September 11, 2019

Availability in PHP 4.0

Create an array containing a range of elements

Parameters

Parameter Data type Default value Note
$low mixed not Low value.
$high mixed not High value.
$step number null If a step value is given, it will be used as the increment between elements in the sequence. step should be given as a positive number. If not specified, step will default to 1.

Return values

array

an array of elements from low to high, inclusive. If low > high, the sequence will be from high to low.

Other resources

Official documentation of the range function

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.