In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to use php to use filter filter to verify email ipv6 address", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "how to use php to use filter filter to verify mailbox ipv6 address"!
1. Verify the mailbox
The copy code is as follows:
$email = 'jb51@qq.com'
$result = filter_var ($email, FILTER_VALIDATE_EMAIL)
Var_dump ($result); / / string (14) "jb51@qq.com"
2. Verify the url address
The copy code is as follows:
$url = "https://www.jb51.net";
$result = filter_var ($url, FILTER_VALIDATE_URL)
Var_dump ($result); / / string (22) "https://www.jb51.net"
3. Verify the ip address
The copy code is as follows:
$url = "192.168.1.110"
$result = filter_var ($url, FILTER_VALIDATE_IP)
Var_dump ($result); / / string (13) "192.168.1.110"
Value, this method can also be used to validate ipv6.
The copy code is as follows:
$url = "2001:DB8:2de::e13"
$result = filter_var ($url, FILTER_VALIDATE_IP)
Var_dump ($result); / / string (17) "2001:DB8:2de::e13"
4. Verify whether the value is an integer and within an integer interval
The copy code is as follows:
$I = '010'
$result = filter_var (
$I
FILTER_VALIDATE_INT
/ / set the numerical range of the check
Array (
'options' = > array (' min_range' = > 1, 'max_range' = > 100)
)
);
Var_dump ($result); / / bool (false)
The variables of php are weakly typed, and it will be true if you don't use a filter and directly use the greater-than-less symbol to judge.
The copy code is as follows:
$I = '010'
$result = $I > = 1 & $I
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.