How to use multiget with memcache in PHP
Just like the title, how would a multiget from memcache look like?
Is this the correct way of utilizing multiget? :
$memcache_obj = new Memcache;
$memcache_obj->connect('memcache_host', 11211);
$var = $memcache_obj->get(Array('some_key', 'second_ke开发者_运维技巧y'));
Thanks
UPDATE: anyone looking to do the same, check out this addition as well: http://www.craigiam.com/blog/19/memcached-multiget-using-php-pecl-memcache-class
Big thanks to Pascal_Martin for solving the issue!
Considering that Memcache::get accepts, as its first parameter, either one key, or an array of keys, I'd say it is ;-)
Quoting :
You can pass array of keys to
Memcache::get()
to get array of values.
The result array will contain only found key-value pairs.
精彩评论