Memcached::replaceByKey

(PECL memcached >= 0.1.0)

Memcached::replaceByKeyReplace the item under an existing key on a specific server

說明

public bool Memcached::replaceByKey ( string $server_key , string $key , mixed $value [, int $expiration ] )

Memcached::replaceByKey() is functionally equivalent to Memcached::replace(), except that the free-form server_key can be used to map the key to a specific server. This is useful if you need to keep a bunch of related keys on a certain server.

參數

server_key

本鍵名用於識別儲存和讀取值的伺服器。沒有將實際的鍵雜湊到具體的項目,而是在決定與哪一個 memcached 伺服器通信時將其雜湊為伺服器鍵值。這使得關連的項目在單一伺服上被組合起來以提高多重操作的效率。

key

用於儲存值的鍵名。

value

儲存的值。

expiration

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

回傳值

如果成功則回傳 TRUE,失敗則回傳 FALSE。 The Memcached::getResultCode() will return Memcached::RES_NOTSTORED if the key does not exist.

參見

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top