(PECL memcached >= 0.1.0)
Memcached::increment — 锟斤拷锟斤拷锟斤拷值元锟截碉拷值
$key
[, int $offset
= 1
] ) : int
Memcached::increment()锟斤拷一锟斤拷锟斤拷值元锟斤拷锟斤拷锟接诧拷锟斤拷offset
指锟斤拷锟侥达拷小锟斤拷
锟斤拷锟皆拷氐锟街碉拷锟斤拷锟斤拷锟街碉拷锟斤拷停锟斤拷锟斤拷锟斤拷锟轿�0锟斤拷锟斤拷锟斤拷锟皆拷夭锟斤拷锟斤拷锟�Memcached::increment()失锟杰★拷
key
要锟斤拷锟斤拷值锟斤拷元锟截碉拷key锟斤拷
offset
要锟斤拷元锟截碉拷值锟斤拷锟接的达拷小锟斤拷
锟缴癸拷时锟斤拷锟斤拷元锟截碉拷锟斤拷值 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
锟斤拷锟絢ey锟斤拷锟斤拷锟斤拷Memcached::getResultCode()锟斤拷锟斤拷锟斤拷锟斤拷Memcached::RES_NOTFOUND
锟斤拷
Example #1 Memcached::increment() 示锟斤拷
<?php
$m = new Memcached();
$m->addServer('localhost', 11211);
$m->set('counter', 0);
$m->increment('counter');
$m->increment('counter', 10);
var_dump($m->get('counter'));
$m->set('key', 'abc');
$m->increment('counter');
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
int(11) string(1) "1"