From f9678a8a249d454788442939e9771900be1c2e2b Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 12 Jan 2005 19:03:52 +0000 Subject: [PATCH] describe multi-get and clarify the result value if the item wasn't found git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@177093 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/memcache/functions/memcache-get.xml | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/reference/memcache/functions/memcache-get.xml b/reference/memcache/functions/memcache-get.xml index 460a3e3da5..c0a90c1576 100644 --- a/reference/memcache/functions/memcache-get.xml +++ b/reference/memcache/functions/memcache-get.xml @@ -1,5 +1,5 @@ - + Memcache::get @@ -11,6 +11,10 @@ mixedMemcache::get stringkey + + mixedMemcache::get + arraykeys + Memcache::get returns previously stored data if an item with such key exists on the server at this @@ -31,12 +35,28 @@ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $var = $memcache_obj->get('some_key'); +/* +You also can use array of keys as a parameter. +If such item wasn't found at the server, the result +array simply will not include such key. +*/ + +/* procedural API */ +$memcache_obj = memcache_connect('memcache_host', 11211); +$var = memcache_get($memcache_obj, Array('some_key', 'another_key')); + +/* OO API */ +$memcache_obj = new Memcache; +$memcache_obj->connect('memcache_host', 11211); +$var = $memcache_obj->get((Array('some_key', 'second_key')); + ?> ]]> - Memcache::get returns &false; on failure. + Memcache::get returns &false; on failure or + if such key was not found.