如果我使用以下代码,我会在文本文件中获取数据
{"title":"sankas","description":"sakars","code":"sanrs"}
{"title":"test","description":"test","code":"test"}
但我的代码正在运行
{"title":"sankas","description":"sakars","code":"sanrs"}
所以我无法添加更多行。我想更改以获得正确的结果。
$info = array();
$folder_name = $this->input->post('folder_name');
$info['title'] = $this->input->post('title');
$info['description'] = $this->input->post('description');
$info['code'] = $this->input->post('code');
$json = json_encode($info);
$file = "./videos/overlay.txt";
$fd = fopen($file, "a"); // a for append, append text to file
fwrite($fd, $json);
fclose($fd);