Forum und email

Memcache::delete

(PECL memcache:0.2-2.1.2)

Memcache::delete — Delete item from the server

Descripción

bool Memcache::delete ( string $key [, int $timeout ] )

Memcache::delete() deletes item with the key . If parameter timeout is specified, the item will expire after timeout seconds. Also you can use memcache_delete() function.

Lista de parámetros

key

timeout

Valores retornados

Devuelve TRUE si todo se llevó a cabo correctamente, FALSE en caso de fallo.

Ejemplos

Example#1 Memcache::delete() example

<?php

/* procedural API */
$memcache_obj memcache_connect('memcache_host'11211);

/* after 10 seconds item will be deleted by the server */
memcache_delete($memcache_obj'key_to_delete'10);

/* OO API */
$memcache_obj = new Memcache;
$memcache_obj->connect('memcache_host'11211);

$memcache_obj->delete('key_to_delete'10);

?>

Ver también

  • Memcache::set()
  • Memcache::replace()