update : 2015.11.03
php.shukuma.com

검색:
 
 
Concatenates to a record

TokyoTyrant::putCat

(PECL tokyo_tyrant >= 0.1.0)

TokyoTyrant::putCatConcatenates to a record

설명

public TokyoTyrant TokyoTyrant::putCat ( mixed $keys [, string $value ] )

Appends a value into existing key or multiple values if keys is an array. The second parameter is mandatory if keys is a string. If the record does not exist a new record is created.

인수

keys

A string key or an array of key-value pairs

value

The value in case a string key is used

반환값

This method returns a reference to the current object and throws TokyoTyrantException on failure.

예제

Example #1 TokyoTyrant::putCat() example

<?php
/* Connect to a database on default port */
$tt = new TokyoTyrant("localhost");

/* Create a new key */
$tt->put("key""value");

/* Concatenate single key-value pair */
$tt->putCat("key"" has more data");

/* Echo the key */
echo $tt->get("key");
?>

위 예제의 출력:

value has more data

참고