Документация PHP


Memcache::flush

Memcache::getExtendedStats

Memcache Функции

PHP Manual


Memcache::get

(PECL memcache:0.2-2.1.2)

Memcache::get — Retrieve item from the server

Описание

string Memcache::get ( string $key [, int &$flags ] )

array Memcache::get ( array $keys [, array &$flags ] )

Memcache::get() returns previously stored data if an item with such key exists on the server at this moment.

You can pass array of keys to Memcache::get() to get array of values. The result array will contain only found key-value pairs.

Список параметров

key

The key or array of keys to fetch.

flags

If present, flags fetched along with the values will be written to this parameter. These flags are the same as the ones given to for example Memcache::set(). The lowest byte of the int is reserved for pecl/memcache internal usage (e.g. to indicate compression and serialization status).

Возвращаемые значения

Returns the string associated with the key or FALSE on failure or if such key was not found.

Примеры

Пример #1 Memcache::get() example

<?php

/* procedural API */
$memcache_obj memcache_connect('memcache_host'11211);
$var memcache_get($memcache_obj'some_key');

/* OO API */
$memcache_obj = new Memcache;
$memcache_obj->connect('memcache_host'11211);
$var $memcache_obj->get('some_key');

/* 
You also can use array of keys as a parameter.
If such item wasn't found at the server, the result
array simply will not include such key.
*/

/* procedural API */
$memcache_obj memcache_connect('memcache_host'11211);
$var memcache_get($memcache_obj, Array('some_key''another_key'));

/* OO API */
$memcache_obj = new Memcache;
$memcache_obj->connect('memcache_host'11211);
$var $memcache_obj->get(Array('some_key''second_key'));

?>


Memcache::flush

Memcache::getExtendedStats

Memcache Функции

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…