WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML


 

PHP 7 - Constant Arrays


PHP 7 array can be use define() function.


Example

<?php
   //define a array using define function
   define('Coastredwood', [
      'Coast redwood',
      'Sitka spruce',
      'Giant sequoia'
   ]);
   print(Coastredwood[1]);
?>

Try it yourself »

It gives result are: