Memcache 함수 목록
PHP Manual

Memcache::delete

(PECL memcache >= 0.2.0)

Memcache::deleteDelete 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

The key associated with the item to delete.

timeout

Execution time of the item. If it's equal to zero, the item will be deleted right away whereas if you set it to 30, the item will be deleted in 30 seconds.

반환값

성공할 경우 TRUE를, 실패할 경우 FALSE를 반환합니다.

예제

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);

?>

참고


Memcache 함수 목록
PHP Manual