CopyPastehas never been so tasty!

Create array using therange () function in PH

by anonymous

  • 0
  • 0
  • 0



Arrays in php:


Arrays are just like the variable that store values but we can use arrays to store more than one value. Variable only store one value. There are three types of arrays


  • Numeric arrays
  • Associative array
  • Multidimensional array


Range () function in PHP:


This function is use to create an array by defining the range of elements. Range is a built-in php functions to use for arrays.






     Low:  use to define lowest value of array


     High: use to define highest value of array


Creating array using range () function in PHP:


To create an array in php we have more than one method but in this article we use range () function for creating an array in php. In the given code we use range () function to create an array this function takes high and low value range for array as a parameter and create array according to that range. The range of this array is from 0 to 6.





   $die = range(0,6);

   // Same as specifying $die = array(0,1,2,3,4,5,6)




Above is a simple code to create an array using range() function is php.



This simple article tells that how we create an array using range function in php.

Add A Comment: