php man page for range

Query: range

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

RANGE(3)								 1								  RANGE(3)

range - Create an array containing a range of elements

SYNOPSIS
array range (mixed $start, mixed $end, [number $step = 1])
DESCRIPTION
Create an array containing a range of elements.
PARAMETERS
o $start - First value of the sequence. o $end - The sequence is ended upon reaching the $end value. o $step - If a $step value is given, it will be used as the increment between elements in the sequence. $step should be given as a posi- tive number. If not specified, $step will default to 1.
RETURN VALUES
Returns an array of elements from $start to $end, inclusive.
EXAMPLES
Example #1 range(3) examples <?php // array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) foreach (range(0, 12) as $number) { echo $number; } // The step parameter // array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100) foreach (range(0, 100, 10) as $number) { echo $number; } // Usage of character sequences // array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'); foreach (range('a', 'i') as $letter) { echo $letter; } // array('c', 'b', 'a'); foreach (range('c', 'a') as $letter) { echo $letter; } ?>
NOTES
Note Character sequence values are limited to a length of one. If a length greater than one is entered, only the first character is used.
SEE ALSO
shuffle(3), array_fill(3), foreach. PHP Documentation Group RANGE(3)
Related Man Pages
array(3) - php
substr_replace(3) - php
array_slice(3) - php
ctype_punct(3) - php
range(3) - php
Similar Topics in the Unix Linux Community
How to initialize array with a larger number?
Test shell script step by step?
How to get started with Unix
Make all words begin with capital letter?
Run the Script from any stage by updating data from Oracle Table.