导航首页 »  技术教程 »  PHP APC函数:apc_fetch()的用法
PHP APC函数:apc_fetch()的用法 1050 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



文章评论 (0条)
发表评论
暂无评论,快来抢沙发吧~