(PECL memcached >= 0.1.0)
Memcached::replaceByKey — Replace the item under an existing key on a specific server
$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.