Answer the question
In order to leave comments, you need to log in
Is it possible to store multidimensional arrays in yii2 cache?
The documentation has a multiSet method. He works:
$data = [
'yep' => '1',
'hey' => '2'
];
$cache->multiSet($data);
$data = [
'pages' => [
'index' =>
[
'1' => 'hey',
]
]
];
Answer the question
In order to leave comments, you need to log in
Multidimensional arrays can be stored and not only using multiSet. MultiSet is aware of several items at once. In each of them, there can be a multidimensional array.
What stopped you from checking? Is it 2 lines of code?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question