Added Form Validation rule for alphanum + spaces.
Signed-off-by: Sajan Parikh <sajan@noppix.com>
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index bbd0b52..7b9215c 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -1230,6 +1230,21 @@
}
// --------------------------------------------------------------------
+
+ // --------------------------------------------------------------------
+
+ /**
+ * 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