Your IP address is: 54.90.185.120
Saturday 17th of November 2018 08:02:33 AM

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”?>