【发布时间】:2013-04-19 14:46:48
【问题描述】:
我有一段代码接受 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 取消转义引号以便我可以对其进行解码的任何建议?
【问题讨论】:
标签: php json codeigniter escaping decode