15 of 110 menu

The array Function in PHP

The array function creates an array in PHP:

<?php $arr = array('text1', 'text2', 'text3'); ?>

Currently, a more modern approach is to create an array using square brackets [ ], like this:

<?php $arr = ['text1', 'text2', 'text3']; ?>

See Also

English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline