Memcached::replace

(PECL memcached >= 0.1.0)

Memcached::replaceReplace the item under an existing key

說明

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

Memcached::replace() is similar to Memcached::set(), but the operation fails if the key does not exist on the server.

參數

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