confirm password in codeigniter

In the form validation rules array in the config/form_validation.php file, add the 'matches' rule for the confirm password field.
In the controller, create a validation rule for the confirm password field using the set_rules() method.
In the view file, add the input field for the confirm password and handle the validation errors if any.