1 cache.inc cache_get($cid, $bin = 'cache')

Returns data from the persistent cache.

Data may be stored as either plain text or as serialized data. cache_get() will automatically return unserialized objects and arrays.

Parameters

string $cid: The cache ID of the data to retrieve.

string $bin: The cache bin from which data should be retrieved. Valid core values are "cache", "bootstrap", "field", "filter", "form", "menu", "page", "path", "update", "views", and "views_data". Bin names may include the prefix of "cache_", but it is stripped out before execution.

Return value

The cache or FALSE on failure.

File

core/includes/cache.inc, line 58
Functions and interfaces for cache handling.

Code

function cache_get($cid, $bin = 'cache') {
  return cache($bin)->get($cid);
}