Numeric Array
![](https://www.devopsschool.com/blog/wp-content/uploads/2020/02/Untitled-Diagram-1.png)
Sample Program
Output:- Rahul
Array Function
Array() function is used to create an array.
Syntax
$array_name = array(“value1″,”value2″,”value3”,……..);
For Example
$name = array(“Sushant”,”Rahul”,”Sameer”,”sujeet”);
Note:- By Default, array starts with index 0.
Sample Program
Output
![](https://www.devopsschool.com/blog/wp-content/uploads/2020/02/array-function-output.png)
Double Array Operator
The => operator lets you create key/index – value pairs in the array. The item on the left of the => is the key/index and the item on the right is the value.
For Example:- $name = array(1=>”Sushant”, 3=>”Rahul”, 7=>”Sujeet”, 12=>”Amit”);
In the Above Example, we assigned the index of the array’s. See Below,
$name[1] = Sushant,
$name[3] = Rahul,
$name[7] = Sujeet,
$name[12] = Amit,
Note:- When we assign a value in first array and left others, then next array will automatically assign next value of the previous array.
![loading](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/gallery-page-loader.gif)
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
![loading](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/gallery-page-loader.gif)
With MotoShare.in, you can book a bike instantly, enjoy doorstep delivery, and ride without worries. Perfect for travelers, professionals, and adventure enthusiasts looking for a seamless mobility solution.