在PHP上使用Redis 给多个键值进行自增,示例如下:
$set['money'] = $this->redis->hIncrByFloat($key, $hour .'_money', $data['money']);
$set['ip'] = $this->redis->hIncrBy($key, $hour .'_ip', $data['ip']);
$set['uv'] = $this->redis->hIncrBy($key, $hour .'_uv', $data['uv']);
$set['pv'] = $this->redis->hIncrBy($key, $hour .'_pv', $data['pv']);
$this->redis->hSet($key, $hour, array($data['money'], $data['ip'], $data['uv'], $data['pv']));
页:
[1]