本来看起来结构清晰的 JSON 文件(有换行和缩进),在被如下程序更新之后就变成只有一行了. 有什么办法让缩进换行结构保持不变吗?谢谢。
$updatedContent = json_encode($tables);
file_put_contents($file, $updatedContent);
本来看起来结构清晰的 JSON 文件(有换行和缩进),在被如下程序更新之后就变成只有一行了. 有什么办法让缩进换行结构保持不变吗?谢谢。
$updatedContent = json_encode($tables);
file_put_contents($file, $updatedContent);