❮PHP筛选器参考
从电子邮件地址中删除所有非法字符:
<?php $email = "john(.doe)@exa//mple.com"; $email = filter_var($email, FILTER_SANITIZE_EMAIL); echo $email; ?>
FILTER_SANITIZE_EMAIL过滤器从电子邮件地址中删除所有非法字符。