Memcache::close

(PECL memcache >= 0.4.0)
Close memcached server connection
bool Memcache::close ( void )

Memcache::close() closes connection to memcached server. This function doesn't close persistent connections, which are closed only during web-server shutdown/restart. Also you can use memcache_close() function.

Returns:

Returns TRUE on success or FALSE on failure.

Examples:
Memcache::close() example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
 
/* procedural API */
$memcache_obj = memcache_connect('memcache_host', 11211);
/* 
do something here ..
*/
memcache_close($memcache_obj);
 
/* OO API */
$memcache_obj new Memcache;
$memcache_obj->connect('memcache_host', 11211);
/* 
do something here ..
*/
$memcache_obj->close();
 
?>
See also:

Memcache::connect() -

Memcache::pconnect() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.