Home > PHP > Function > Memcache > Memcache::get()

Memcache::get()

Memcache::get - Retrieve item from the server

Syntax

array Memcache::get (string $key, int &$flags, array $keys, array &$flags, string $key, int &$flags, array $keys, array &$flags)

Arguments

  • 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).
  • keys
  • flags
  • 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).
  • keys
  • flags

Description

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

Version

PHP PECL memcache >= 0.2.0

Return value

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