title: How to convert multidimensional array into json object
body: <p>i have an issue in array to json conversion, I have an array and i want to convert this array into json objects, desired output given below so any one please help me.</p>
  
  <p>Php array</p>
  
  <pre><code>    Array
  (
      [0] =&gt; Array
          (
              [application_id] =&gt; 132
              [application_status] =&gt; SUBMITTED
              [reference_number] =&gt; 
              [salutation] =&gt; 
              [first_name] =&gt; 
              [middle_name] =&gt; 
              [last_name] =&gt; 
              [mother_name] =&gt; 
  
  
          )
  
      [1] =&gt; Array
          (
              [application_id] =&gt; 148
              [application_status] =&gt; SUBMITTED
              [reference_number] =&gt; 
              [salutation] =&gt; 
              [first_name] =&gt; 
              [middle_name] =&gt; 
              [last_name] =&gt; 
              [mother_name] =&gt; 
  
  
          )
  
      [2] =&gt; Array
          (
              [application_id] =&gt; 154
              [application_status] =&gt; SUBMITTED
              [reference_number] =&gt; 
              [salutation] =&gt; 
              [first_name] =&gt; 
              [middle_name] =&gt; 
              [last_name] =&gt; 
              [mother_name] =&gt; 
  
  
          )
  
      [3] =&gt; Array
          (
              [application_id] =&gt; 182
              [application_status] =&gt; SUBMITTED
              [reference_number] =&gt; 
              [salutation] =&gt; 
              [first_name] =&gt; 
              [middle_name] =&gt; 
              [last_name] =&gt; 
              [mother_name] =&gt; 
  
  
          )
  
      [4] =&gt; Array
          (
              [application_id] =&gt; 186
              [application_status] =&gt; SUBMITTED
              [reference_number] =&gt; 
              [salutation] =&gt; 
              [first_name] =&gt; 
              [middle_name] =&gt; 
              [last_name] =&gt; 
              [mother_name] =&gt; 
  
  
  
          )
  
  )
  </code></pre>
  
  <p>Convert above array to json object like this:</p>
  
  <pre><code>[
          {
              "application_id": "1",
              "application_status": "0",
              "reference_number": "/index",
              "salutation": "index",
              "first_name": "Index",
              "middle_name": "Home",
              "last_name": "1",
  
          },
          {
              "application_id": "1",
              "application_status": "0",
              "reference_number": "/index",
              "salutation": "index",
              "first_name": "Index",
              "middle_name": "Home",
              "last_name": "1",
  
          },
          {
              "application_id": "1",
              "application_status": "0",
              "reference_number": "/index",
              "salutation": "index",
              "first_name": "Index",
              "middle_name": "Home",
              "last_name": "1",
  
          },
          {
              "application_id": "1",
              "application_status": "0",
              "reference_number": "/index",
              "salutation": "index",
              "first_name": "Index",
              "middle_name": "Home",
              "last_name": "1",
  
          },
          {
              "application_id": "1",
              "application_status": "0",
              "reference_number": "/index",
              "salutation": "index",
              "first_name": "Index",
              "middle_name": "Home",
              "last_name": "1",
  
          },
  
  ]  
  </code></pre>