Array: Etl Labs PVT LTD - PHP
Array: Etl Labs PVT LTD - PHP
<?php
The index can be assigned automatically
$cars
(index always starts at 0), like this:
= array("Volvo", "BMW", "Toyota
");
3 $cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[0] . ",
" . $cars[1] . " and " .
$cars[2] . "."; or the index can be assigned manually:
?>
$cars[0] = "Volvo";
$cars[1] = "BMW";
$cars[2] = "Toyota";
$age['Peter'] = "35";
$age['Ben'] = "37";
$age['Joe'] = "43";
A multidimensional array
is an array containing one
or more arrays.
PHP understands
multidimensional arrays
that are two, three, four,
five, or more levels deep.