php - 我想用 php 更新值 json
问题描述
想改一些,比如description,把value改成test2 form url json
{
"title": "test",
"description": "test",
"keyword": "test",
"ogimage": "test",
"radio": "test",
"noscript": "test",
"fbpage": "test",
"pagesID": "test",
"payIMG": "test",
"titlepay": "test",
"font": "test"
}
解决方案
希望对你有帮助
<?php
$jsonString = '{
"title": "test",
"description": "test",
"keyword": "test",
"ogimage": "test",
"radio": "test",
"noscript": "test",
"fbpage": "test",
"pagesID": "test",
"payIMG": "test",
"titlepay": "test",
"font": "test"
}';
$data = json_decode($jsonString, true);
$data['description'] = "test2";
$data = json_encode($data);
推荐阅读
- android - Json Object Volley 没有价值
- javascript - 在 react-admin 框架中未经授权时如何重定向到登录页面
- java - Java 8 函数式编程
- types - Isabelle 中的 oops 类型
- c# - Where函数c#中的lambda默认值问题
- amazon-web-services - AWS Step Functions 未捕获 States.Runtime 错误
- highcharts - 如何在highcharts中将宽甘特图导出为JPG或PNG?
- bootstrap-4 - SASS - Bootstrap 4 - 尝试使用“按钮大小”混合时出错
- android - 构建 apk 中缺少 Expo manifest.android.config
- powershell - 如何在过程中锁定文件并在使用完PowerShell后解锁?