PHP: Array

This entry is part 20 of 54 in the series PHP Tutorial

An array is an ordered list.

It can be created using the array() language construct.


$gift = array("TV","car","aeroplane"); 

echo "I want a " . $gift[0] . ", a " . $gift[1] . ", and an " . $gift[2];											

The gift array is first constructed using an array() statement.

Items in the array will be put in a list accessible by gift[0], gift[1] and gift[2].

Series Navigation<< PHP: Arithmetic operators
PHP: Array count >>

Leave a comment

Leave a Reply