PHP8 apcu_delete

2023-08-28 15:39 更新

(PECL apcu >= 4.0.0)

apcu_delete—從緩存中刪除存儲的變量

說明

apcu_delete(mixed $key): mixed

從緩存中刪除存儲的變量。

參數(shù)

key

一個 key ,用于將值存儲為單個鍵的字符串,或存儲為多個鍵的字符串?dāng)?shù)組,或存儲為APCUIterator對象。

返回值

如果key是一個數(shù)組,則返回鍵的索引數(shù)組。否則,成功時返回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


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號