arrays are used to store more than one value in a single variable. For example, if you have a list of fruits you can store their names in a single variable.
arrays are used to store more than one value in a single variable. For example, if you have a list of fruits you can store their names in a single variable.
<?php
$array = array('Apple', 'Mango', 'Banana', 'Apricot', 'Blackberry');
?>
This is equivalent to the following example, in which indexes are assigned manually:
<?php
$array[0] = 'Apple';
$array[1] = 'Mango';
$array[2] = 'Banana';
$array[3] = 'Apricot';
$array[4] = 'Blackberry';
?>