首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

apc_load_constants

(PECL apc >= 3.0.0)

apc_load_constants - 从缓存中加载一组常量

描述

代码语言:javascript
复制
bool apc_load_constants ( string $key [, bool $case_sensitive = true ] )

从缓存中加载一组常量。

参数

key

常量集的名称(与apc_define_constants()一起存储)将被检索。

case_sensitive

常量的默认行为是声明区分大小写的;即CONSTANTConstant表示不同的值。如果此参数评估为FALSE常量,则将声明为不区分大小写的符号。

返回值

成功时返回TRUE或失败时返回FALSE

示例

Example #1 apc_load_constants() example

代码语言:javascript
复制
<?php
$constants = array(
    'ONE'   => 1,
    'TWO'   => 2,
    'THREE' => 3,
);
apc_define_constants('numbers', $constants);
apc_load_constants('numbers');
echo ONE, TWO, THREE;
?>

上面的例子将输出:

代码语言:javascript
复制
123

See Also

  • apc_define_constants() - 定义一组用于检索和批量定义的常量
  • define() - 定义一个命名常量
  • constant() - 返回一个常量的值
  • 或者PHP常量引用

← apc_inc

apc_sma_info →

扫码关注腾讯云开发者

领取腾讯云代金券