语法
Cache::get(string $key,$default = null);
示例代码
<?phprequire '../vendor/autoload.php';use renpengpeng\Cache;Cache::connect(['type' => 'File','file' => ['cache_dir' => realpath(__DIR__).DIRECTORY_SEPARATOR.'cache']],true);// 不指定默认值$get = Cache::get('string');var_dump($get); // 输出 null// 指定默认值$get = Cache::get('string','noString');var_dump($get); // 输出 noString
参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| key | string | 缓存键 |
| default | any | 默认值 |
