PHP解析json字符串问题json_decode($_POST, true)phpjson格式化输出
解析结果为null
<?php
// the following strings are valid JavaScript but not valid JSON
// the name and value must be enclosed in double quotes
// single quotes are not valid
$bad_json = "{ 'bar': 'baz' }";
json_decode($bad_json); // null
// the name must be enclosed in double quotes
$bad_json = '{ bar: "baz" }';
json_decode($bad_json); // null
/
/ trailing commas are not allowed
$bad_json = '{ bar: "baz", }';
json_decode($bad_json); // null
json_encode 第⼆个参数

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。