Latest web development tutorials

PHP constant array

PHP 7 New Features PHP 7 New Features

Const defined only through the constant array, PHP 7 may be defined by define () in PHP 5.6 in.

Examples

<?php
// 使用 define 函数来定义数组
define('sites', [
   'Google',
   'w3big',
   'Taobao'
]);

print(sites[1]);
?>

The above program execution output is:

w3big

PHP 7 New Features PHP 7 New Features