diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-01-05 17:31:59 +0100 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-01-05 17:31:59 +0100 |
commit | 5c561805bd9ae6a4ad5d202277c34a879617b683 (patch) | |
tree | ce6fb66d7df410d45bce84e6d0df5b8b042c27e3 | |
parent | 865d46f31b52727c7885aa4b92f7cb4041fc05fe (diff) |
If the data is an array output them one at a time. E.g: form_input('name[]', set_value('name[]');
-rw-r--r-- | system/libraries/Form_validation.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 38f50fa41..f45760024 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -736,6 +736,13 @@ class CI_Form_validation { return $default; } + // If the data is an array output them one at a time. + // E.g: form_input('name[]', set_value('name[]'); + if (is_array($this->_field_data[$field]['postdata'])) + { + return array_shift($this->_field_data[$field]['postdata']); + } + return $this->_field_data[$field]['postdata']; } |