PHP 手册
上一页 |  | 下一页

# Memcache::delete

(no version information, might be only in CVS)

Memcache::delete -- Delete item from the server

## 说明

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.

## 参数

`key`

`timeout`

## 返回值

如果成功则返回 `TRUE`，失败则返回 `FALSE`。

## 范例

例 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); ?>`

## 参见

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

上一页 | 起始页 | 下一页
Memcache::decrement | 上一级 | Memcache::flush