最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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);
发布评论

评论列表(0)

  1. 暂无评论