How to use multiget with memcache in PHP

Like the name, what does a multigame from memcache look like?

Is this the right way to use multiget?

$memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $var = $memcache_obj->get(Array('some_key', 'second_key')); 

thanks

UPDATE: anyone who wants to do the same, check out this add-on: http://www.craigiam.com/blog/19/memcached-multiget-using-php-pecl-memcache-class

Many thanks to Pascal_Martin for solving the problem!

+4
source share
1 answer

Given that Memcache :: get takes as its first parameter either a single key or an array of keys, I would say this :-)


Citation:

You can pass an array of keys Memcache::get() to get an array of values.
The result array will contain only the found key-value pairs.

+6
source

Source: https://habr.com/ru/post/1308292/


All Articles