我绑到这个jsonString传递给我的查询解码JSON字符串解码返回null
xxxxxx=createVenue&clientId=2&jsonString={"veneue":{"clientId":"b","name":"d","tagline":"f","phone":"b","address":"d","city":"f","state":"b","zip":"d","twitter":"f","license":"d","imagePath":"f","pickupLocation":"b"},"drinks":[{"type":"d","name":"f","servingTable":{"servingSize":"b","price":"d"}},{"type":"d","name":"f","servingTable":{"servingSize":"b","price":"d"}}],"spirits":[{"type":"d","name":"f","servingTable":{"servingSize":"b","price":"d"}},{"type":"d","name":"f","servingTable":{"servingSize":"b","price":"d"}}]}
但是,当我在PHP解码它返回null。
$clientId = trim($_REQUEST['clientId']);
$jsonString = trim($_REQUEST['jsonString']);
$decodedJSON = json_decode($jsonString);
return $decodedJSON;
$ decodedJSON返回null;
出了什么问题?
你有没有尝试'urldecode()'之前''json_decode()'? –
提示:*检查* trim($ _ REQUEST ['jsonString'])'的值(并通过验证程序运行以确定哪个部分现在无效) – user2864740
什么是投票的最低点? –