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
Post a Comment