You can put input values in an array before validation rules. I do not know what manipulations you want to do, but you can do such things.
$dat = array(
'fname' => filter_var($this->input->post('fname'), FILTER_SANITIZE_STRING),
'lname' => filter_var($this->input->post('lname'), FILTER_SANITIZE_STRING),
'email' => filter_var($this->input->post('email'), FILTER_SANITIZE_EMAIL),
'phone' => $this->input->post('phone'),
'relate' => filter_var($this->input->post('relate'), FILTER_SANITIZE_STRING),
);
$this->form_validation->set_rules('lname', 'Last Name', 'required|trim|min_length[3]');
then on
$this->db->update('contacts', $dat);
You can use most of the things in the array to manage it before setting the rules.
source
share