title: Is it possible to return $var1 & $var2 in Codeigniter?
body: <p>Let's say in my model, I have a function queries and variable array. I need to pass variable $m to the results back to my controller to display in my view.</p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>  for($i=1; $i&lt;=12;)
      {
       $month=array("","01","2","3","4","5","6","7","8","9","10","11","12");
      $m = $month[$i];
      $query2=$this-&gt;db-&gt;query("
          SELECT 
            COUNT(*) AS rr 
          FROM
            trans_email 
          WHERE lup LIKE '2014-$m%' 
          ");
      $resultarray[$i]=$query2-&gt;result();
      foreach($resultarray[$i] as $row)
              {
                $data[$i] = $row;
              }
               $i++;
  
  
      }
      return $data;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>$this-&gt;load-&gt;model('dash_model');
  $ind = $this-&gt;dash_model-&gt;monthreport();
   $data= array();
   $data['mont'] = $ind;  
   $this-&gt;parser-&gt;parse('blank.htm', $data);
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>{mont}
  {rr}
  {/mont}
  </code></pre>
  
  <p>Output array $data</p>
  
  <pre><code> [mont] =&gt; Array
      (
          [1] =&gt; stdClass Object
              (
                  [rr] =&gt; 1
              )
  
          [2] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  
          [3] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  
          [4] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  
          [5] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  
          [6] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  
          [7] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  
          [8] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  
          [9] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  
          [10] =&gt; stdClass Object
              (
                  [rr] =&gt; 4
              )
  
          [11] =&gt; stdClass Object
              (
                  [rr] =&gt; 9
              )
  
          [12] =&gt; stdClass Object
              (
                  [rr] =&gt; 0
              )
  </code></pre>
  
  <p>how i return var $m to controller to get value 1 - 12 ?</p>