CI natively only allows for single parameter in custom callbacks. For an instance see the following code.
$this->form_validation->set_rules ('hstate', 'State', 'required|callback_suburb_check[' . $suburb . ']');
If you need to pass multiple parameters, you have several options. Obviously you can change CI behaviour by subclassing the core library. But in this tutorial we follow the less pain approach. That ‘s to access required parameters via POST variables within your custom callback function. They are still available in this scope.
There is another way using your PHP string handling knowledge. Just formatting all the parameters as single string and passing to the callback function.
$parameters = 'first_arg' . '||' . 'second_arg' . '||' . 'third_arg'; $this->form_validation->set_rules ('some_field', 'Some Field Name', 'callback__my_callback_function['.$parameters.']');
Then in your callback,
function _my_callback_function($field_value, $second_parameter){ list($first_param, $second_param, $third_param) = split('||', $second_parameter); ... }