The difference between the add replace set
recently encountered a problem in the interview memcache the difference between the add and replace set, so this step is to add a cached data to the server, when the key already exists will return a false, otherwise return a truereplace is to replace a cached data within the server, return a false if the key does not exist, or return true set is the collection of add and replace, if the key exists in the substitution, does not exist on the set, the return is true
Increment Decrement Delete addition subtraction delete operation
Example: $memcache=NewMemcahe (); $memcache->connect ('localhost','11211'); $memcache-Set("value",3); $memcache->increment ("value",5);//Can be used as a counter, increment 5 $memcache at a time->decrement ("value",6);
$value = $memcache->get ("value"); 2
$memcache->delete ("value");
$memcahe->flush ();//Set all caches to expire and do not delete
PHP memcache Add replace set differences and other usage collection