2017-03-07 101 views

回答

6

在这里,这应该有助于您排序。

use Storage; 

$json = Storage::disk('local')->get('calendar_Ids.json'); 
$json = json_decode($json, true); 
+0

刚刚在底部看到了你的编辑,这对我来说非常合适。谢谢! –

+0

对。看我的编辑。试试'json_decode($ json,true);' –

2

试试这个

$path = '/storage/app/calendar_Ids.json'; 
$content = json_decode(file_get_contents($path), true);` 

然后就dd($content);,看看它是否工作。

+0

这为我工作,但你知道,如果有使用Laravel做一个具体的办法? –

0

你可以试试这个太:

$json = storage_path('folder/filename.json'); 
+0

这只是生成资源目录中给定文件的标准路径。没有阅读文件内容。 –

相关问题