php - filter_var returns false with valid emails -


i made function takes emails csv , stores them in database, problem filter_var returning false.

i have in loop

$email = trim(str_replace('"', "", $row[0])); if(filter_var($email, filter_validate_email)){     //save }else{     echo "failed: -$email-".mb_detect_encoding($email)."<br/>"; } 

when executed, echos emails meaning it's failing, echoed emails valid, theres no spaces or quotes or anything, i've placed dashes before , after see if there any.

failed: -email@gmail.com-ascii 

is failing because of aschii encoding?


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -