PHP8 apcu_delete
2023-08-28 15:39 更新
(PECL apcu >= 4.0.0)
apcu_delete—从缓存中删除存储的变量
说明
apcu_delete(mixed $key): mixed
从缓存中删除存储的变量。
参数
key
一个
key
,用于将值存储为单个键的字符串,或存储为多个键的字符串数组,或存储为APCUIterator对象。
返回值
如果key是一个数组,则返回键的索引数组。否则,成功时返回true,失败时返回false。
示例
示例 #1 A apcu_delete() example
<?php
$bar = 'BAR';
apcu_store('foo', $bar);
apcu_delete('foo');
// this is obviously useless in this form
// Alternatively delete multiple keys.
apcu_delete(['foo', 'bar', 'baz']);
// Or use an Iterator with a regular expression.
apcu_delete(new APCUIterator('#^myprefix_#'));
?>
参见
- apcu_store() - 缓存一个变量到存储中
- apcu_fetch() - Fetch a stored variable from the cache
- apcu_clear_cache() - Clears the APCu cache
- APCUIterator
以上内容是否对您有帮助:
更多建议: