I am trying to push array and then implode them
$this->input->post('sarana')
this is array for my checkbox
<input type="checkbox" class="flat" name="sarana[]" id="sarana" value="listrik" />penerangan listrik
<input type="checkbox" class="flat" name="sarana[]" id="sarana" value="listrik" />penerangan listrik
and then I want push input type post mobil /motor /tv
<input type="text" name="mobil" placeholder="mobil" class="form-control input-sm">
controller
$tv=$this->input->post('tv');
$motor=$this->input->post('motor');
$mobil=$this->input->post('mobil');
$sarana=$this->input->post('sarana');
array_push($sarana, 'tv=$tv','motor=$motor','mobil=$mobil');
$data = array(
'idakun' =>29,
'kondisirumah' =>$this->input->post('fisikrumah'),
'statusrumah' =>$this->input->post('pemilikanrumah'),
'sarana' =>implode(",", $sarana),
'ekonomi' =>$this->input->post('ekonomi'),
'hpkeluarga' =>implode(",",$this->input->post('hpkeluarga')),
);
but it is giving error as
array_push() expects parameter 1 to be array, null given