Skip to content

Commit 5a7a3b6

Browse files
committed
Merge pull request #11 from onkelzfreak1988/patch-2
update is_email()
2 parents 3c15ef8 + d771c8d commit 5a7a3b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

system/library/functions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,10 @@ function format_money( $number, $add_currency = false ){
356356

357357

358358
/**
359-
* Return true if the email is valid
359+
* Return true if the email is valid else false
360360
*/
361-
function is_email( $string ){
362-
return eregi( "^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $string );
361+
function is_email( $email ){
362+
return preg_match('|^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$|i', $email );
363363
}
364364

365365
/**

0 commit comments

Comments
 (0)