PHP FILTER_SANITIZE_EMAIL 过滤器
示例
从电子邮件地址中删除所有非法字符
<?php
$email = "john(.doe)@exa//mple.com";
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
echo $email;
?>
尝试一下 »
定义和使用
FILTER_SANITIZE_EMAIL 过滤器将从电子邮件地址中删除所有非法字符。
❮ PHP 过滤器参考
从电子邮件地址中删除所有非法字符
<?php
$email = "john(.doe)@exa//mple.com";
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
echo $email;
?>
尝试一下 »
FILTER_SANITIZE_EMAIL 过滤器将从电子邮件地址中删除所有非法字符。
If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]
If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]