Encoding PHP array to JSON, how to encode square brackets [] Wed, 09/02/2015 To make square brackets in JSON, which is basically array in JSON you need to write array twice. So make it array(array('something'.... $data = json_encode(array( 'list'=>array(array('commerce_price_aud' => array (.... Drupal 7 Other View the discussion thread.