Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$mc = new Memcached();
$mc->setOption(
Memcached::OPT_DISTRIBUTION,
Memcached::DISTRIBUTION_CONSISTENT
);
$mc->addServers(array(
array('localhost', 11211),
array('localhost', 11212),
array('localhost', 11213),
array('localhost', 11214)
));
for($i=0;$i<=10;$i++){
var_dump($mc->get('key_' . $i));
echo "<\br>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment