title: Array to son without index
body: <p>I have this code, basically take some lines and put in a array in groups of 4</p>
  
  <p>Originally the data comes in this format:</p>
  
  <pre><code>line1
  line2
  line3
  line4
  line5
  line6
  line7
  line8
  </code></pre>
  
  <p>and with this code i pass the lines to array:</p>
  
  <pre><code>$addresses = [];
  foreach (preg_split("/((\r?\n)|(\r\n?))/", $nodes) as $line) {
      $temp[] = trim($line);
      if(count($temp) == 4){
          array_push($addresses,[
                      'ADDRESS' =&gt; $temp[0],
                      'STREET_NAME' =&gt; $temp[1],
                      'TOWN_NAME' =&gt; $temp[2],
                      'POST_CODE' =&gt; $temp[3]
                  ]);
        $temp = [];
    }
  }
  var_dump(json_encode($addresses,JSON_PRETTY_PRINT));
  </code></pre>
  
  <p>But the result its not what i want... :</p>
  
  <pre><code>{
    "1": {
        "ADDRESS": "10",
        "STREET_NAME": "TRIQ ID-DAR TA` PULTU",
        "TOWN_NAME": "BIRZEBBUGA",
        "POST_CODE": "BBG 1810"
    },
    "2": {
        "ADDRESS": "12",
        "STREET_NAME": "TRIQ ID-DAR TA` PULTU",
        "TOWN_NAME": "BIRZEBBUGA",
        "POST_CODE": "BBG 1810"
    }
  }
  </code></pre>
  
  <p>And i dont want the index...</p>
  
  <p>i need something like this:</p>
  
  <pre><code>[
  {
    "ADDRESS": "10",
    "STREET_NAME": "TRIQ ID-DAR TA` PULTU",
    "TOWN_NAME": "BIRZEBBUGA",
    "POST_CODE": "BBG 1810"
  },
  {
    "ADDRESS": "12",
    "STREET_NAME": "TRIQ ID-DAR TA` PULTU",
    "TOWN_NAME": "BIRZEBBUGA",
    "POST_CODE": "BBG 1810"
  }
  ]
  </code></pre>
  
  <p>Any idea about the mistake???</p>