Your IP address is: 3.84.139.101
Sunday 21st of July 2019 06:30:59 PM

Constant arrays using define()

Constant arrays using define()

Array constants can now be defined with define(). In PHP 5.6, they could only be defined with const.

<?php
define('ANIMALS', [    'dog',
'cat',
'bird']);
echo ANIMALS[1]; // outputs “cat”?>