{
"default_module":"Index",
"url_model":2,
"session_auto_start":true
}
test控制器内容如下:namespace app\admin\controller;
use think\Config;
class Index extends Controller
{
public function test()
{
$test = Config::parse(APP_PATH . 'config.json');
dump($test);
$test = file_get_contents(APP_PATH . 'config.json');
dump($test);
dump(json_decode($test));
}
}
输出如下:NULL
string(71) "{
"default_module":"Index",
"url_model":2,
"session_auto_start":true
}
"
ob
["default_module"] => string(5) "Index"
["url_model"] => int(2)
["session_auto_start"] => bool(true)
}
最佳答案
