Adds multiple values to the cache in one call.
Parameters
$data
arrayrequired- Array of keys and values to be added.
$group
stringoptional- Where the cache contents are grouped.
Default:
''
$expire
intoptional- When to expire the cache contents, in seconds.
Default 0 (no expiration).
Source
public function add_multiple( array $data, $group = '', $expire = 0 ) {
$values = array();
foreach ( $data as $key => $value ) {
$values[ $key ] = $this->add( $key, $value, $group, $expire );
}
return $values;
}
Changelog
Version | Description |
---|---|
6.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.