From 4ff02b11a4fffc6a1021966d2b86591c02312576 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 19 Jul 2016 14:33:27 +0000 Subject: [PATCH] verify : add email test git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2914 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- verify.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/verify.php b/verify.php index a8def12..8db912e 100644 --- a/verify.php +++ b/verify.php @@ -129,4 +129,16 @@ class verify return FALSE; return TRUE; } + + //////////////// + // EMAILS // + //////////////// + /** Return TRUE if the provided value is a valid email address + * @param string $val The value to check + * @return boolean + */ + public function is_email ($val) + { + return !! filter_var ($val, FILTER_VALIDATE_EMAIL); + } }