admin管理员组文章数量:1025208
I have a variable named
var type = [];
where i do
type.push({'type' : 1});
and finally i get the following object:
[{"type":"1"},{"type":"2"},{"type":"3"},{"type":"4"}]
by doing JSON.stringify();
but how can i get the type inside PHP?
I have a variable named
var type = [];
where i do
type.push({'type' : 1});
and finally i get the following object:
[{"type":"1"},{"type":"2"},{"type":"3"},{"type":"4"}]
by doing JSON.stringify();
but how can i get the type inside PHP?
Share Improve this question asked Jul 17, 2011 at 17:27 stergoszstergosz 5,87013 gold badges65 silver badges134 bronze badges 01 Answer
Reset to default 5You can use json_decode
$object = json_decode($json);
I have a variable named
var type = [];
where i do
type.push({'type' : 1});
and finally i get the following object:
[{"type":"1"},{"type":"2"},{"type":"3"},{"type":"4"}]
by doing JSON.stringify();
but how can i get the type inside PHP?
I have a variable named
var type = [];
where i do
type.push({'type' : 1});
and finally i get the following object:
[{"type":"1"},{"type":"2"},{"type":"3"},{"type":"4"}]
by doing JSON.stringify();
but how can i get the type inside PHP?
Share Improve this question asked Jul 17, 2011 at 17:27 stergoszstergosz 5,87013 gold badges65 silver badges134 bronze badges 01 Answer
Reset to default 5You can use json_decode
$object = json_decode($json);
本文标签: javascriptDecode and get data of JS object in PHPStack Overflow
版权声明:本文标题:javascript - Decode and get data of JS object in PHP - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745617593a2159383.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论