Is FILTER_VALIDATE_URL being too strict?

后端 未结 4 1337
[愿得一人]
[愿得一人] 2021-02-12 16:26

In PHP, filter_var(\'www.example.com\', FILTER_VALIDATE_URL) returns false. Is this correct? Isn\'t www.example.com a valid URL, or protoc

4条回答
  •  天命终不由人
    2021-02-12 17:01

    The URL have to correspond with the rules set forward in RFC 2396, and according to that spec the protocol is necessary.

提交回复
热议问题