Array and Its Type in PHP
#phparray #array #php
PHP Arrays
An array stores multiple values in one single variable:
What is an Array?
An array is a special variable, which can hold more than one value at a time.
If you have a list of items (a list of car names, for example), storing the cars in single variables could look like this:
$cars1 = "Volvo";
$cars2 = "BMW";
$cars3 = "Toyota";
Create an Array in PHP
In PHP, the array() function is used to create an array:
$cars = array("Volvo", "BMW", "Toyota",3,”coded fork”,2.4);