title: send array from controller to model in codeigniter
body: <p>Hello i need help i am trying to pass three different variables from the controller of a codeigniter to model so i created an array and pass it then i exploded and i am getting the error <strong>explode() expects parameter 2 to be string, array given</strong></p>
  
  <p>The controller</p>
  
  <pre><code> $data = array(
                  'district_id' =&gt; $this-&gt;input-&gt;post('district') ,
                  'limit' =&gt; $limit,
                  'offset' =&gt; $offset,
  
              );
  
  
     $data['tubadili'] = $this-&gt;wapi_db-&gt;search_bar($data);
  </code></pre>
  
  <p>The Model function</p>
  
  <pre><code>public function search_bar($data){
  
      $dataArray = explode(',' , $data);
  
      $district_id = $dataArray[0];
  
      $limit = $dataArray[1];
  
      $offset = $dataArray[2];
  
      $this-&gt;db-&gt;select('entertainment.Name,entertainment.ID,entertainment.Category,entertainment.Location,entertainment.Description,
                         image.ImagePath,image.Enter_ID,entertainment.DistrictID');
  
      $this-&gt;db-&gt;from('entertainment');
  
      $this-&gt;db-&gt;join('image', 'image.Enter_ID=entertainment.ID');
  
       $this-&gt;db-&gt;where('entertainment.Category',"Bar");
  
       $this-&gt;db-&gt;where('entertainment.DistrictID', $district_id);
  
  
      $this-&gt;db-&gt;limit($limit, $offset);
  
      $query = $this-&gt;db-&gt;get();
  
      return $query-&gt;result();
  
  
  
  
  
  
  
  
  }
  </code></pre>