-1

Does anyone know an elegant way of turning this string to array

{"Order_status":{"order_country":"IN","order_flat":0,"order_currncy":"INR"}}

need to convert the above string to array

array('Order_staus'=>array('order_country'=>'IN','order_flat'=>0,'order_currency'=>'INR'))
0

2 Answers 2

0

Use json_decode($JSONstr) to convert json string to php array

and wise verse json_encode($phparray) to convert to jsonstr

Sign up to request clarification or add additional context in comments.

Comments

0

Use json_decode

<?php
$s = '{"Order_status":{"order_country":"IN","order_flat":0,"order_currncy":"INR"}}';
var_dump(json_decode($s, true));

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.