码迷,mamicode.com
首页 > Web开发 > 详细

转化为json方式函数

时间:2014-12-11 12:08:30      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:http   io   ar   color   os   sp   for   on   数据   

1,我的数据格式是:

{"message":"","code":0,"data":[{"Order":{"sku":"YA01204","last_updated":"2014-12-10T03:01:29","product_id":"540ac3b8150f190a4e25c576","order_time":"2014-12-09T18:14:18","color":"blue","price":"2.0","shipping_cost":"1.7","shipping":"2.0","ShippingDetail":{"phone_number":"8622681563","city":"Newton","state":"New Jersey","name":"Hector l Ponce","country":"US","zipcode":"07860","street_address1":"9 Foster St"},"order_id":"54873bfa77f07a43b16a0ba4","state":"APPROVED","cost":"1.7","variant_id":"540ac3b9150f190a4e25c57c","order_total":"3.4","days_to_fulfill":"6","product_image_url":"http:\/\/contestimg.wish.com\/api\/webimage\/540ac3b8150f190a4e25c576-normal.jpg","product_name":"New Visible LED Flash Light USB Sync Charger Cable for iPhone 4 4s iPod Touch 4","transaction_id":"54873bf9073c01105cf0ff18","quantity":"1"}},{"Order":{"sku":"PA04401","last_updated":"2014-12-10T03:04:31","product_id":"540ac3ba9fd3f80a4e5a50b0","order_time":"2014-12-09T18:56:36","color":"black","price":"3.0","shipping_cost":"0.85","shipping":"1.0","ShippingDetail":{"phone_number":"5182383320","city":"Cohoes","state":"New York","name":"Gerald Falconio","country":"US","zipcode":"12047","street_address1":"154 Van Schaick 

 

2,我要把这些数据转化为json方式的数组:

$arr = json_decode($pramer);//$pramer 这个就是上面打印出来的一个变量。
当你打印的时候你就可以得到你所想要的数组了。

转化为json方式函数

标签:http   io   ar   color   os   sp   for   on   数据   

原文地址:http://www.cnblogs.com/kobigood/p/4157165.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!