Your IP address is: 54.90.204.233
Sunday 24th of March 2019 10:51:14 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”?>