我有一段代码接受 JSON 字符串作为 POST 参数。我面临的挑战是如何解码字符串。考虑一个mygateway.php
具有以下领域meta
的帖子:
{"test" : "One \"quote\" is as good as an escaped \"quote\"..."}
如果我运行:
$meta_json_string = $this->CI->post('meta', true);
$meta_json_string 的值为:
{
"test": "One "quote" is as good as an escaped "quote"..."
}
运行时无法解码json_decode()
。关于如何防止 CodeIgniter 取消转义引号以便我可以对其进行解码的任何建议?