[php] 2025-01-17 圈点655
摘要:php和js中对json对象及json字符串的转换示例
php和js中对json对象及json字符串的转换示例:
JS中JSON的处理
JSON对象 ==> String
JSON.stringify(JsonObject);
String ==> JSON对象
JSON.parse(String);
php中JSON的处理
String ==> 数组
json_decode(string,true)
String ==> JSON对象
json_decode(string)
JSON对象 ==> String
json_encode(JSON对象)