Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

cache an array

$value = "foo"; // dynamic string value

if(Cache::has('key')){
  $newValue = Cache::get('key');
  $newValue[] = $value;
  Cache::put('key', $newValue);
}else{
  Cache::put('key', Arr::wrap($value));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #cache #array
ADD COMMENT
Topic
Name
4+3 =