title: JSON objects to array conversion
body: <p>I have a multidimensional array assigned to single variable 'data'. I prepared array as follows:</p>
  
  <pre><code>$img1 = [
      'title' =&gt; 'example',
      'description' =&gt; 'description'
  ];
  $imagesArray[] = [
       'img1' =&gt; [
          'normal' =&gt; $img1
       ]
   ];
  $data = [
       'data' =&gt; [
          'images' =&gt; $imagesArray
      ],
      'message' =&gt; 'OK'
   ];
  </code></pre>
  
  <p>When encode it as JSON array, following output is produced.</p>
  
  <pre><code>{
      "images":{
          "normal":{
              {
              "title" : "example1",
              "description" : "description1"
              },
              {
              "title" : "example2",
              "description" : "description2"
              }
          }
      }
   } 
  </code></pre>
  
  <p>But I require following output:</p>
  
  <pre><code>{
      "images":[
          "normal":[
              [
              "title" : "example1",
              "description" : "description1"
              ],
              [
              "title" : "example2",
              "description" : "description2"
              ]
          ]
      ]
   } 
  </code></pre>
  
  <p>Do anyone have solution? ..Thanks in advance</p>