轉化為json方式函數

來源:互聯網
上載者:User

標籤: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方式函數

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.