PHP array() Function

PHP provides various array functions to access and manipulate the elements of array. The important PHP array functions are given below.PHP array() function creates and returns an array. It allows you to create indexed, associative and multidimensional arrays.

Example -

The following example demonstrates how to create a two-dimensional array, how to specify keys for associative arrays, and how to skip-and-continue numeric indices in normal arrays.

Example -