The title of this article should be array(), but due to technical restrictions, cannot contain parenthesis.

Creates an array, a block of related data elements.

array() is not actually a function, but rather a language construct used to represent literal arrays.

Arguments Edit

{{{returns}}} array (mixed input)

Argument Inclusion Edit

(PHP 3, PHP 4, PHP 5)

Examples Edit

Example 1: Edit

 array $fruits (apple, orange, pear, peach);
 print_r $fruits

Output Edit

 Array (
   [0] => apple
   [1] => orange
   [2] => pear
   [3] => peach
For more details on this function, visit its entry in the php manual.