TokyoTyrant::get
(PECL tokyo_tyrant >= 0.1.0)
TokyoTyrant::get — The get purpose
Description
This method is used to return a value or multiple values. This method accepts a string or an array as a value.
Return Values
Returns a string or an array based on the given parameters. Throws a TokyoTyrantException on error. If string is passed null is returned if the key is not found. In case an array is given as an parameter only existing keys will be returned. It is not an error to pass a key that does not exist.
Examples
Example #1 TokyoTyrant::get() example
<?php
$tt = new TokyoTyrant("localhost", 1978);
$tt->put("key1", "value1");
$tt->put("key2", "value2");
var_dump($tt->get(array("key1", "key2")));
var_dump($tt->get("key1"));
?>
The above example will output:
array(2) { ["key1"]=> string(6) "value1" ["key2"]=> string(6) "value2" } string(6) "value1"
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с базами данных
- Расширения для работы с базами данных отдельных производителей
- tokyo_tyrant
- Функция TokyoTyrant::add() - Adds to a numeric key
- Функция TokyoTyrant::connect() - Connect to a database
- Функция TokyoTyrant::connectUri() - Connects to a database
- Функция TokyoTyrant::__construct() - Construct a new TokyoTyrant object
- Функция TokyoTyrant::copy() - Copies the database
- Функция TokyoTyrant::ext() - Execute a remote script
- Функция TokyoTyrant::fwmKeys() - Returns the forward matching keys
- Функция TokyoTyrant::get() - The get purpose
- Функция TokyoTyrant::getIterator() - Get an iterator
- Функция TokyoTyrant::num() - Number of records in the database
- Функция TokyoTyrant::out() - Removes records
- Функция TokyoTyrant::put() - Puts values
- Функция TokyoTyrant::putCat() - Concatenates to a record
- Функция TokyoTyrant::putKeep() - Puts a record
- Функция TokyoTyrant::putNr() - Puts value
- Функция TokyoTyrant::putShl() - Concatenates to a record
- Функция TokyoTyrant::restore() - Restore the database
- Функция TokyoTyrant::setMaster() - Set the replication master
- Функция TokyoTyrant::size() - Returns the size of the value
- Функция TokyoTyrant::stat() - Get statistics
- Функция TokyoTyrant::sync() - Synchronize the database
- Функция TokyoTyrant::tune() - Tunes connection values
- Функция TokyoTyrant::vanish() - Empties the database
Коментарии
404 Not Found