summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSajan Parikh <sajan@noppix.com>2013-02-02 15:00:39 +0100
committerSajan Parikh <sajan@noppix.com>2013-02-02 15:00:39 +0100
commit2d1608a6325d55ab31c55c27c31052c2daa76e46 (patch)
tree79c8b52a7a377753e98ef1984c04863a0c471863
parent2ccb60ed153a7c86c31a230c08bd42f22111398a (diff)
Added Form Validation rule for alphanum + spaces.
Signed-off-by: Sajan Parikh <sajan@noppix.com>
-rw-r--r--system/libraries/Form_validation.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index bbd0b523e..7b9215c04 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -1230,6 +1230,21 @@ class CI_Form_validation {
}
// --------------------------------------------------------------------
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Alpha-numeric w/ spaces
+ *
+ * @param string
+ * @return bool
+ */
+ public function alpha_numeric_spaces($str)
+ {
+ return (bool) preg_match('#^[A-Z0-9 ]+$#i', $str);
+ }
+
+ // --------------------------------------------------------------------
/**
* Alpha-numeric with underscores and dashes