2008-03-12
Memcache::get
关键字: memcached, php, 取值, 多值, 多项Memcache::get
说明
string Memcache::get ( string key )array Memcache::get ( array keys )
Memcache::get() returns previously stored data if an item with 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.
范例
例 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'));
?>
- 14:33
- 浏览 (133)
- 评论 (0)
- 分类: 缓存技术-Memcached
- 相关推荐
发表评论
最近加入圈子
最新评论
-
网络营销策划方案
2007年中国电子邮件营销市场规模达2.5亿元
-- by madsun -
网络营销策划方案
http://www.shang-ba.com/?p=68 2007年中国电子 ...
-- by madsun -
网络营销策划方案
[url= http://www.shang-ba.com/?p=68]200 ...
-- by madsun -
网络营销策划方案
[url= http://www.shang-ba.com/?p=68]2007 ...
-- by madsun -
DHTML checkbox 选择的几 ...
function doFlgCheckedCheck() { if (docu ...
-- by congpeixue







评论排行榜