array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'memcache.get.php', 1 => 'Memcache::get', 2 => 'Retrieve item from the server', ), 'up' => array ( 0 => 'class.memcache.php', 1 => 'Memcache', ), 'prev' => array ( 0 => 'memcache.flush.php', 1 => 'Memcache::flush', ), 'next' => array ( 0 => 'memcache.getextendedstats.php', 1 => 'Memcache::getExtendedStats', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/memcache/memcache/get.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PECL memcache >= 0.2.0)
Memcache::get -- memcache_get — Retrieve item from the server
Memcache::get() returns previously stored data of
an item, if such key exists on the server at this
moment.
You can pass array of keys to Memcache::get() to get array of values. The result array will contain only found key-value pairs.
keyflags
Returns the value associated with the key or
an array of found key-value pairs when key is an array.
Returns false on failure, key is not found or
key is an empty array.
Örnek 1 Memcache::get() example
<?php
/* procedural API */
$memcache_obj = memcache_connect('memcache_host', 11211);
$var = memcache_get($memcache_obj, 'some_key');
/* OO API */
$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'));
?>