更新时间:2022-02-15 09:23:36
缓存PHP数组非常简单:
Caching a PHP array is pretty easy:
file_put_contents($path, '<?php return '.var_export($my_array,true).';?>');
然后您可以将其读出:
if (file_exists($path)) $my_array = include($path);
您可能还想查看ADOdb ,它提供了缓存内部.
You might also want to look into ADOdb, which provides caching internally.