CI_Cache::increment()

increment($id[, $offset = 1])

Parameters:
  • $id (string) – Cache ID
  • $offset (int) – Step/value to add
Returns:

New value on success, FALSE on failure

Return type:

mixed

Performs atomic incrementation of a raw stored value.

1
2
3
4
5
// 'iterator' has a value of 2
 
$this->cache->increment('iterator'); // 'iterator' is now 3
 
$this->cache->increment('iterator', 3); // 'iterator' is now 6
doc_CodeIgniter
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.