cache_put_data

Description

If caching is enabled, this function puts data in the cache by calling the appropriate function based on what you're using.

Syntax

void cache_put_data (string $key, mixed $value[, int $ttl])



Parameter $key

Expected type: String
Description: The name to use for whatever's being stored



Parameter $value

Expected type: Mixed
Description: What to store in the cache

Allowed types for $value
Allowed values Description
Array An array of data to store in the cache
Null Null - deletes the data for the specified key from the cache



Parameter $ttl

Expected type: Integer
Description: "Time To Live" - how long to store the data in the cache before it's deleted (in seconds). Default is 120 (2 minutes)


Notes

  • Returns false if caching is disabled
Advertisement: