CakeFest 2024: The Official CakePHP Conference

Memcached::fetchAll

(PECL memcached >= 0.1.0)

Memcached::fetchAll读取所有剩余结果

说明

public Memcached::fetchAll(): array|false

Memcached::fetchAll() 从最后一次请求中检索所有剩余结果。

参数

此函数没有参数。

返回值

返回结果集 或者在失败时返回 false。 如需要则使用 Memcached::getResultCode()

示例

示例 #1 Memcached::getDelayed() 示例

<?php
$m
= new Memcached();
$m->addServer('localhost', 11211);

$m->set('int', 99);
$m->set('string', 'a simple string');
$m->set('array', array(11, 12));

$m->getDelayed(array('int', 'array'), true);
var_dump($m->fetchAll());
?>

以上示例会输出:

array(2) {
  [0]=>
  array(3) {
    ["key"]=>
    string(3) "int"
    ["value"]=>
    int(99)
    ["cas"]=>
    float(2363)
  }
  [1]=>
  array(3) {
    ["key"]=>
    string(5) "array"
    ["value"]=>
    array(2) {
      [0]=>
      int(11)
      [1]=>
      int(12)
    }
    ["cas"]=>
    float(2365)
  }
}

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top