php-arrays function-range-set up an array containing the specified range of cells _php tutorial

Source: Internet
Author: User
Range () function

function
The function returns the cells from low to high in the array,
contain themselves, if low>high, then sequence from high to low
"Scope of Use"
>=3.0.8, PhP4, PHP5
Use
Range (First,second,step)
first/required/specified minimum value of array element
second/required/specified array element maximum value
step/optional/specified interval between elements/default is 1/This parameter is added after PHP5
Example
[PHP]
Print_r (Range (0, 5));
Print_r (Range (5, 1));
Print_r (Range (0, 5, 2));
Print_r (Range (0, 5, 3));
/*
Array
(
[0] = 0
[1] = 1
[2] = 2
[3] = 3
[4] = 4
[5] = 5
)
Array
(
[0] = 5
[1] = 4
[2] = 3
[3] = 2
[4] = 1
)
Array
(
[0] = 0
[1] = 2
[2] = 4
)
Array
(
[0] = 0
[1] = 3
)
*/


Excerpts from Zuodefeng's notes

http://www.bkjia.com/PHPjc/478195.html www.bkjia.com true http://www.bkjia.com/PHPjc/478195.html techarticle The function " function" of the range () function returns the cells from low to high in the array, including themselves, if Lowhigh, the sequence from high to low "use range" =3.0.8, PhP4, php5 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.