Index For Arrays

A index is the identifier of an specific element in an array. They may automatically generated, by simply omitting them at creation time.

PHP index may be integers or strings only. Other data types generate an error or a type conversion. For example, floats are turned into integer. integer-shaped strings will also be turned into integer.

PHP index start at 0. They may be automatically assigned by appending a new value with the [] operator : then, they use the greatest available index + 1.

<?php
    $array = ['a', 'b', 'c'];

    echo $array[0];
?>

Documentation

Related : Array