CI_Form_validation::_reset_post_array PHP Method

_reset_post_array() protected method

Re-populate the _POST array with our finalized and processed data
protected _reset_post_array ( ) : void
return void
    protected function _reset_post_array()
    {
        foreach ($this->_field_data as $field => $row) {
            if ($row['postdata'] !== NULL) {
                if ($row['is_array'] === FALSE) {
                    isset($_POST[$field]) && ($_POST[$field] = $row['postdata']);
                } else {
                    // start with a reference
                    $post_ref =& $_POST;
                    // before we assign values, make a reference to the right POST key
                    if (count($row['keys']) === 1) {
                        $post_ref =& $post_ref[current($row['keys'])];
                    } else {
                        foreach ($row['keys'] as $val) {
                            $post_ref =& $post_ref[$val];
                        }
                    }
                    $post_ref = $row['postdata'];
                }
            }
        }
    }