= 2.0.0)Memcached::touchByKey — Set a new expiration on an item on a specific server說明public Memcached::touchByK">

Memcached::touchByKey

(PECL memcached >= 2.0.0)

Memcached::touchByKeySet a new expiration on an item on a specific server

說明

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

Memcached::touchByKey() is functionally equivalent to Memcached::touch(), except that the free-form server_key can be used to map the key to a specific server.

參數(shù)

server_key

本鍵名用于識別儲存和讀取值的服務(wù)器。沒有將實(shí)際的鍵名散列到具體的項(xiàng)目,而是在決定與哪一個(gè) memcached 服務(wù)器通信時(shí)將其散列為服務(wù)器鍵名。這使得關(guān)聯(lián)的項(xiàng)目在單一的服務(wù)上被組合起來以提高多重操作的效率。

key

用于存儲值的鍵名。

expiration

到期時(shí)間,默認(rèn)為 0。 更多信息請參見到期時(shí)間。

返回值

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。 如需要?jiǎng)t使用 Memcached::getResultCode()

參見