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
This commit is contained in:
Antony Dovgal 2005-01-12 19:03:52 +00:00
parent c5ff12273c
commit f9678a8a24

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry id="function.Memcache-get">
<refnamediv>
<refname>Memcache::get</refname>
@ -11,6 +11,10 @@
<type>mixed</type><methodname>Memcache::get</methodname>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>mixed</type><methodname>Memcache::get</methodname>
<methodparam><type>array</type><parameter>keys</parameter></methodparam>
</methodsynopsis>
<para>
<function>Memcache::get</function> returns previously stored data if
an item with such <parameter>key</parameter> 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'));
?>
]]>
</programlisting>
</example>
<para>
<function>Memcache::get</function> returns &false; on failure.
<function>Memcache::get</function> returns &false; on failure or
if such <parameter>key</parameter> was not found.
</para>
</refsect1>
</refentry>