Memcached::fetch

(PECL memcached >= 0.1.0)

Memcached::fetchObtener el siguiente resultado

Descripción

public Memcached::fetch(): array

Memcached::fetch() obtiene el siguiente resultado de la última petición.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Devuelve el siguiente resultado o false en caso contrario. Memcached::getResultCode() devolverá Memcached::RES_END si el conjunto de resultados se ha agotado.

Ejemplos

Ejemplo #1 Ejemplo de Memcached::fetch()

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

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

$m->getDelayed(array('int', 'array'), true);
while (
$resultado = $m->fetch()) {
var_dump($resultado);
}
?>

El resultado del ejemplo sería algo similar a:

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

Ver también

add a note add a note

User Contributed Notes

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