PHP FILTER_SANITIZE_EMAIL 过滤器

PHP 教程 · 2019-01-25 20:41:55

定义和用法

FILTER_SANITIZE_EMAIL 过滤器删除字符串中所有非法的 e-mail 字符。

该过滤器允许所有的字母、数字以及 $-_.+!*'{}|^~[]`#%/?@&=

  • Name: "email"
  • ID-number: 517

实例


<?php
$var="some(one)@exa\mple.com";
var_dump(filter_var($var, FILTER_SANITIZE_EMAIL));
?>

代码的输出如下所示:


string(19) "someone@example.com"


点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Nine Algorithms That Changed the Future

Nine Algorithms That Changed the Future

John MacCormick / Princeton University Press / 2011-12-27 / GBP 19.95

Every day, we use our computers to perform remarkable feats. A simple web search picks out a handful of relevant needles from the world's biggest haystack: the billions of pages on the World Wide Web.......一起来看看 《Nine Algorithms That Changed the Future》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

MD5 加密
MD5 加密

MD5 加密工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具