导航首页 » 技术教程 » PHP APC函数:apc_fetch()的用法
PHP APC函数:apc_fetch()的用法 126 2023-12-15   

apc_fetch

(PECL apc >= 3.0.0)

apc_fetch — 从缓存中取出存储的变量

说明

mixed apc_fetch ( mixed $key [, bool &$success ] )

从缓存中取出存储的变量

参数

key

key 是使用 apc_store() 存储的键名。 如果传递的是一个数组,则数组中的每个元素的值都被返回

success

成功时为 TRUE 失败时 FALSE

返回值

存储一个变量或者一个数组失败时返回; FALSE

范例

Example #1 apc_fetch() 范例

<?php
$bar = 'BAR';
apc_store('foo', $bar);
var_dump(apc_fetch('foo'));
?>

以上例程会输出:

string(3) "BAR"

更新日志

版本 说明 3.0.17 The success parameter was added.

参见

apc_store() - Cache a variable in the data store apc_delete() - 从用户缓存中删除某个变量 APCIterator


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103