Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use php to verify mailbox ipv6 addresses using filter filters

2025-03-31 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report