function foo() { $rules = array('THE RULES HER'); $this->form_validation->set_rules($rules); if($this->form_valitaion->run()) { //foo true } else { //var false } }