Memcached::getServerList

(PECL memcached >= 0.1.0)

Memcached::getServerList锟斤拷取锟斤拷锟斤拷锟斤拷锟斤拷锟叫的凤拷锟斤拷锟斤拷锟叫憋拷

说锟斤拷

public Memcached::getServerList ( void ) : array

Memcached::getServerList()锟斤拷锟截凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫凤拷锟斤拷锟斤拷锟叫憋拷.

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫凤拷锟斤拷锟斤拷锟叫憋拷.

锟斤拷锟斤拷

Example #1 Memcached::getServerList() 示锟斤拷

<?php
$m 
= new Memcached();
$m->addServers(array(
    array(
'mem1.domain.com'1121120),
    array(
'mem2.domain.com'1131180),
));
var_dump($m->getServerList());
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

array(2) {
  [0]=>
  array(3) {
    ["host"]=>
    string(15) "mem1.domain.com"
    ["port"]=>
    int(11211)
    ["weight"]=>
    int(20)
  }
  [1]=>
  array(3) {
    ["host"]=>
    string(15) "mem2.domain.com"
    ["port"]=>
    int(11311)
    ["weight"]=>
    int(80)
  }
}