將讀寫改為實際檔案,再用讀檔的方式載入。
file = fopen(FCPATH."/ajax/rand_list.json","w");
fputs(file,json_encode(list));
fclose(file);
json = file_get_contents(FCPATH."/ajax/rand_list.json");
return json;
文章標籤
全站熱搜
將讀寫改為實際檔案,再用讀檔的方式載入。
file = fopen(FCPATH."/ajax/rand_list.json","w");
fputs(file,json_encode(list));
fclose(file);
json = file_get_contents(FCPATH."/ajax/rand_list.json");
return json;