title: How to get separate array values in controllers of php codeigniter?
body: <p>This Is My Model...</p>
  
  <pre><code> function data($company,$month,$year) {
      $query = $this-&gt;db-&gt;query("select * from wage where company='" . $company . "' and month='".$month."' and year ='".$year."' ");
      if ($query-&gt;num_rows() &gt; 0) {
          return $query-&gt;result_array();
      }
  }
  </code></pre>
  
  <p>This Is My Controller</p>
  
  <pre><code> $data = $this-&gt;excel_model-&gt;data($company, $month, $year);
  </code></pre>
  
  <p>Data is printing array like this</p>
  
  <pre><code>array(2) { [0]=&gt; array(21) { ["worker_id"]=&gt; string(4) "1001" ["name"]=&gt; string(2) "ij"
   [1]=&gt; array(21) { ["worker_id"]=&gt; string(2) "23" ["name"]=&gt; string(10) "avinash k "}
  </code></pre>
  
  <p>I want to store only index value <code>worker_id</code> to another array variable in controller itself.
  Note- I want this data in controller only. </p>