PHP接收JSON [英] PHP receive json

查看:236
本文介绍了PHP接收JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是淘汰赛,这是我的ajax code:

I'm using knockout and this is my ajax code:

save: function() {
                $.ajax({
                    url:"http://localhost/loyalty/welcome/json/",
                    type: "post",
                    data: ko.toJSON(this),
                    contentType: "application/json",
                    success: function (result) { alert(result) }
                });
            }

用Firebug我可以看到JSON消息被正确发送,问题是如何得到它PHP,究竟是什么已发送的名字?

Using firebug I can see that the json message is sent correctly, the problem is how to receive it on PHP, what is the name of what has been sent?

我用codeIgniter

I'm using CodeIgniter

在此先感谢您的帮助。

推荐答案

解决的办法是采取

contentType: "application/json",

从AJAX调用。

from ajax call.

=)

这篇关于PHP接收JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆