array( 'identicalFieldValues' => array( 'rule' => array('identicalFieldValues', 'confirm_email' ), 'message' => 'Please re-enter your password twice so that the values match' ) ) ); function identicalFieldValues( $field=array(), $compare_field=null ) { foreach( $field as $key => $value ){ $v1 = $value; $v2 = $this->data[$this->name][ $compare_field ]; if($v1 !== $v2) { return FALSE; } else { continue; } } return TRUE; } } ?>