PHP Access Arrays

Access Array Item

To access an array item, you can refer to the index number for indexed arrays, and the key name for associative arrays.

Example

Access an item by referring to its index number:

$cars = array("Volvo", "BMW", "Toyota");
echo $cars[2];

Note: The first item has index 0.

To access items from an associative array, use the key name: Continue reading PHP Access Arrays