function getall($host,$port){
$mem=new Memcache();
$mem->connect($host,$port);
$items=$mem->getExtendedStats ('items');
$items=$items["$host:$port"]['items'];
$res=array();
foreach($items as $key=>$values){
$number=$key;
$str=$mem->getExtendedStats ("cachedump",$number,0);
$line=$str["$host:$port"];
if( is_array($line) && count($line)>0){
foreach($line as $key=>$value){
echo $key.'=>';
var_dump($mem->get($key));
echo "\r\n";
$res[$key]=$mem->get($key);
}
}
//
} return $res;
}
转载于:https://my.oschina.net/osmyblog/blog/306042