$config = array( array( 'field' => 'username', 'label' => 'Username', 'rules' => 'trim' ) ); $this->form_validation->set_rules($config);