当前位置:网站首页>What does range mean in PHP

What does range mean in PHP

2022-07-04 07:47:00 Yisu cloud

php in range What does it mean

This article mainly introduces “php in range What does it mean ” Knowledge about , Xiaobian shows you the operation process through practical cases , The operation method is simple and fast , Practical , Hope this article “php in range What does it mean ” The article can help you solve problems .

stay PHP in ,range() Function is to create an array containing elements of a specified range , This function can return an array of elements between the specified two parameters , The grammar is “range(low,high,step)”.

The operating environment of this tutorial :windows10 System 、PHP7.1 edition 、DELL G3 The computer

php in range What does that mean?

range() Function to create an array containing elements of a specified range .

This function returns a containing from low To high An array of elements between .

notes : If low Parameter is greater than the high Parameters , Then the array created will be from high To low.

grammar

range(low,high,step)

Parameters describe

low It's necessary . Specifies the minimum value of an array element .

high It's necessary . Specifies the maximum value of an array element .

step Optional . Specifies the number of steps between elements . The default is 1.

Examples are as follows :

<?php
$number = range(0,5);
print_r ($number);
?>

Output results :

php in range What does it mean

About “php in range What does it mean ” That's all for , Thanks for reading . If you want to know more about the industry , You can pay attention to the Yisu cloud industry information channel , Xiaobian will update different knowledge points for you every day .

原网站

版权声明
本文为[Yisu cloud]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141521322145.html