PHP Array

Prince25

New member
PHP Arrays are used to store multiple values of multiple data types in PHP. In other programming languages you may have heard that array is collection of multiple values of similar data type but in PHP you can store strings, integers, floats and booleans all inside a single array.
 
Array in php are very important construct and the most major value container php supports special type of array called associative array.in which rather using index no we use a name to the index no. like [one]="one"
 
Php array store multiple value in single variable. Array is a special variable. An array can hold many values under a single name, and you can access the values by referring to an index number.
<?php
$cars=array("Volvo","BMW","Toyota");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>
 
Back
Top