PHP8 wincache_ucache_clear — 刪除用戶緩存的全部內(nèi)容

2023-10-12 17:27 更新

(PECL wincache >= 1.1.0)

wincache_ucache_clear — 刪除用戶緩存的全部內(nèi)容。

說明

wincache_ucache_clear(): bool

清除/刪除用戶緩存中存儲的所有數(shù)值。

參數(shù)

此函數(shù)沒有參數(shù)。

返回值

成功時返回 true, 或者在失敗時返回 false。

示例

示例 #1 using wincache_ucache_clear()

<?php
wincache_ucache_set('green', 1);
wincache_ucache_set('red', 2);
wincache_ucache_set('orange', 4);
wincache_ucache_set('blue', 8);
wincache_ucache_set('cyan', 16);
$array1 = array('green', 'red', 'orange', 'blue', 'cyan');
var_dump(wincache_ucache_get($array1));
var_dump(wincache_ucache_clear());
var_dump(wincache_ucache_get($array1));
?> 

以上示例會輸出:

array(5) { ["green"]=> int(1) 
           ["red"]=> int(2) 
           ["orange"]=> int(4) 
           ["blue"]=> int(8) 
           ["cyan"]=> int(16) } 
bool(true) 
bool(false) 

參見

  • wincache_ucache_set() - 向用戶緩存中添加一個變量,并在變量已存在于緩存中時進行覆蓋 
  • wincache_ucache_add() - 僅在變量尚未存在于緩存中時向用戶緩存中添加一個變量 
  • wincache_ucache_delete() - 從用戶緩存中刪除變量 
  • wincache_ucache_get() - 獲取存儲在用戶緩存中的變量 
  • wincache_ucache_exists() - 檢查變量是否存在于用戶緩存中 
  • wincache_ucache_meminfo() - 檢索有關(guān)用戶緩存內(nèi)存使用情況的信息 
  • wincache_ucache_info() - 檢索有關(guān)存儲在用戶緩存中的數(shù)據(jù)的信息


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

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號