Memcache::flush

(PECL memcache >= 1.0.0)
Flush all existing items at the server
bool Memcache::flush ( void )

Memcache::flush() immediately invalidates all existing items. Memcache::flush() doesn't actually free any resources, it only marks all the items as expired, so occupied memory will be overwritten by new items. Also you can use memcache_flush() function.

Returns:

Returns TRUE on success or FALSE on failure.

Examples:
Memcache::flush() example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
 
/* procedural API */
$memcache_obj = memcache_connect('memcache_host', 11211);
 
memcache_flush($memcache_obj);
 
/* OO API */
 
$memcache_obj new Memcache;
$memcache_obj->connect('memcache_host', 11211);
 
$memcache_obj->flush();
 
?>
doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.