Array

array is the array structure in PHP.

It may be written as array() or with square brackets [], which is also called the array short syntax.

The keys that serve as index in the array may be string or integers.

An array assigns automatically an integer index to the values appended to it. An arbitrary index may be assigned with the => syntax, or when accessing an element in the array.

Mixed keys in an array refers to the practice add elements in the array with both the automatic indexing and the arbitrary assignment.

<?php

$array = array(1, 2, 3);

$anotherArray = ['a' => 2, 'b' => 33];

echo $anotherArray['b']; // 33

?>

Documentation

See also https://ashallendesign.co.uk/blog/php-84-array-functions

Related : Index For Arrays, Addition, Comma, Dereferencing, Cryptographic Hash, Hash, Hash, Iterable, List, Map, Sort, Sort, Indexed Array, Associative Array

Related packages : voku/arrayy