title: Get multiple array in Codeigniter and insert to database
body: <p>I have multiple array to insert into database but i don't fix the field name because can select format table data and insert into database but can check field name with $id_template.</p>
  
  <p>This my format table(example)
  <a href="https://i.stack.imgur.com/OAnRm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OAnRm.png" alt="enter image description here"></a></p>
  
  <p>So i want to know how can i get data from multiple array to insert into database</p>
  
  <p>This my code  in controller</p>
  
  <pre><code>    $column = $this-&gt;m_rate_template-&gt;get_column($id_template);
      $colum_detail = implode(",", $column);
      $column_cut = explode(",", $colum_detail);  //example data get format is Array ( [0] =&gt; min [1] =&gt; max)
      foreach ($column_cut as $key =&gt; $val){
  
          $a = $this-&gt;input-&gt;post($column_cut[$key]);
              foreach ($a as $key1 =&gt; $val1){
                  echo $val1;
                  $child_data = array(
                          'id' =&gt; $this-&gt;m_rate_template-&gt;generate_id_in_template($template_name),
                          'id_rate' =&gt; $id_rate,
                          $column_cut[$key] =&gt; $val1
                  );
                  $this-&gt;m_rate_template-&gt;insert_rate($child_data, $template_name);
              }
      }
  </code></pre>