From 10c3f41cbe5bd3bb66fd106cc9fb171ffcc7364b Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 8 Oct 2006 07:21:12 +0000 Subject: --- system/libraries/Validation.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'system/libraries/Validation.php') diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 5322be0e9..07ca35a33 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -478,7 +478,21 @@ class CI_Validation { { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } + + // -------------------------------------------------------------------- + /** + * Validate IP Address + * + * @access public + * @param string + * @return string + */ + function valid_ip($ip) + { + return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE; + } + // -------------------------------------------------------------------- /** -- cgit v1.2.3-24-g4f1b