Memcached::touch

(PECL memcached >= 2.0.0)

Memcached::touchSet a new expiration on an item

說明

public bool Memcached::touch ( string $key , int $expiration )

Memcached::touch() sets a new expiration value on the given key.

參數

key

用於儲存值的鍵名。

expiration

到期時間,預設為 0。 更多訊息參見到期時間

回傳值

如果成功則回傳 TRUE,失敗則回傳 FALSE。 如需要則使用 Memcached::getResultCode()

參見

add a note add a note

User Contributed Notes 2 notes

up
5
Dehumanizer
8 years ago
With PHP 5.4.41 and memcached 1.4.24 it works in ASCII mode as well.
up
5
Pramod Patil
9 years ago
This is only supported when binary protocol is enabled.
$obj = new Memcached();
$obj->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
To Top