Encoding PHP array to JSON, how to encode square brackets [] and deep nested JSON
Deeply nested and squared brackets in JSON To make square brackets in JSON, which is basically array in JSON you need to use the array operator twice, nested. So make it look like this. write some PHP array(array('something'.... $data = json_encode( array ( 'list' => array ( array ( 'commerce_price_aud' => array (.... Here's another example of deeply nested JSON with square brackets. $options = array ( 'name' => 'MySystem' , 'state' => 'INVENTORY' , 'lifeCycleState' => 'INVENTORY' , 'type' => 'My system Type' , 'gateway' => array('serialNumber' => '1234', 'creationDate' => '12345678' ), 'subscription' => array('identifier' => '1234', 'operator' => '12345678' ), 'labels' => array('labege'), 'applica...