Memcached::decrementByKey

(PECL memcached >= 2.0.0)

Memcached::decrementByKeyDecrement numeric item's value, stored on a specific server

说锟斤拷

public Memcached::decrementByKey ( string $server_key , string $key [, int $offset = 1 [, int $initial_value = 0 [, int $expiry = 0 ]]] ) : int

Memcached::decrementByKey() decrements a numeric item's value by the specified offset. If the item's value is not numeric, an error will result. If the operation would decrease the value below 0, the new value will be 0. Memcached::decrementByKey() will set the item to the initial_value parameter if the key doesn't exist.

锟斤拷锟斤拷

server_key

锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷识锟金储达拷投锟饺≈碉拷姆锟斤拷锟斤拷锟斤拷锟矫伙拷薪锟绞碉拷实募锟斤拷锟缴拷械锟斤拷锟斤拷锟斤拷锟斤拷目锟斤拷锟斤拷锟斤拷锟节撅拷锟斤拷锟斤拷锟斤拷一锟斤拷 memcached 锟斤拷锟斤拷锟斤拷通锟斤拷时锟斤拷锟斤拷散锟斤拷为锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷使锟矫癸拷锟斤拷锟斤拷锟斤拷目锟节碉拷一锟侥凤拷锟斤拷锟较憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟竭讹拷锟截诧拷锟斤拷锟斤拷效锟绞★拷

key

The key of the item to decrement.

offset

The amount by which to decrement the item's value.

initial_value

The value to set the item to if it doesn't currently exist.

expiry

The expiry time to set on the item.

锟斤拷锟斤拷值

Returns item's new value on success 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE.

锟轿硷拷