0

PHP7 常量数组

Posted by 撒得一地 on 2016年3月26日 in PHP笔记

在 PHP 5.6 中仅能通过 const 定义常量数组,PHP 7 可以通过 define() 来定义。

实例

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

print(sites[1]);

?>

以上程序执行输出结果为:
biying

上一篇:

下一篇:

相关推荐

发表评论

电子邮件地址不会被公开。 必填项已用*标注

0 + 8 = ?

网站地图|XML地图

Copyright © 2015-2024 技术拉近你我! All rights reserved.
闽ICP备15015576号-1 版权所有©psz.