如何快速輕鬆地保存與php嵌套的JSON。我的意思嵌套是這樣的:如何在php中使用txt文件保存嵌套的json
嵌套的JSON:
{
"key1":"value",
"key2":"value",
"key3":"value",
"key4":{
"key1":"value",
"key2":"value",
"key3":"value"
},
"key5":{
"key1":"value",
"key2":"value",
"key3":"value"
}
}
JSON平原一行(當我剛剛使用echo json_encode($陣列)):
{"key1":"value","key2":"value","key3":"value","key4":{"key1":"value","key2":"value","key3":"value"},"key5":{"key1":"value","key2":"value","key3":"value"}}
我想要這個的原因是json必須易於人類閱讀。當一切都被打上了一條沒有幫助的線路時。
有什麼問題的正確
$options
參數? –