Why does filter_var($email, FILTER_VALIDATE_EMAIL) allow test@test?

前端 未结 4 1784
忘了有多久
忘了有多久 2021-02-08 07:00

I was just setting up the validation for a form in which I decided to try using the filter_var function to check the validity of my email address. I can not find out what filter

4条回答
  •  误落风尘
    2021-02-08 07:47

    It is a valid email address. It isn't going to work on the Internet (at least, not today), but it is fine for a local address.

    I would assume that the developers are taking the sensible approach to checking email addresses and not building themselves a system that is guaranteed to go out of date as soon as a new TLD is introduced. We have enough email address syntax checkers that reject foo@example.museum as it is.

提交回复
热议问题