PHP - Memcache::flush() Function



Memcache::flush() function can flush all existing items at the server.

Syntax

bool Memcache::flush( void )

Memcache::flush() function immediately invalidates all existing items. Memcache::flush() function doesn't free any resources, and it only marks all items as expired, so occupied memory has overwritten by new items. We can also use the memcache_flush() function.

Memcache::flush() function can return true on success or false on failure.

Example

connect("memcache_host", 11211);
   $memcache_obj->flush();
?>
Advertisements