Memcached
PHP Manual

Memcached::addServers

(PECL memcached >= 0.1.1)

Memcached::addServersAdd multiple servers to the server pool

설명

public bool Memcached::addServers ( array $servers )

Memcached::addServers() adds servers to the server pool. Each entry in servers is supposed to an array containing hostname, port, and, optionally, weight of the server. No connection is established to the servers at this time.

The same server may appear multiple times in the server pool, because no duplication checks are made. This is not advisable; instead, use the weight option to increase the selection weighting of this server.

인수

array

Array of the servers to add to the pool.

반환값

성공할 경우 TRUE를, 실패할 경우 FALSE를 반환합니다.

예제

Example #1 Memcached::addServers() example

<?php
$m 
= new Memcached();

$servers = array(
    array(
'mem1.domain.com'1121133),
    array(
'mem2.domain.com'1121167)
);
$m->addServers($servers);
?>

참고


Memcached
PHP Manual