javascript - Decode and get data of JS object in PHP - Stack Overflow

I have a variable namedvar type = [];where i dotype.push({'type' : 1});and finally i get the

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 0
Add a ment  | 

1 Answer 1

Reset to default 5

You can use json_decode

$object = json_decode($json);

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745617594a4636328.html

相关推荐

  • javascript - Decode and get data of JS object in PHP - Stack Overflow

    I have a variable namedvar type = [];where i dotype.push({'type' : 1});and finally i get the

    5小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信