PHP FILTER_VALIDATE_REGEXP 过滤器
PHP 教程
· 2019-01-25 22:59:07
定义和用法
FILTER_VALIDATE_REGEXP 过滤器根据兼容 Perl 的正则表达式来验证值。
- Name: "validate_regexp"
- ID-number: 272
可能的选项:
- regexp - 规定验证所依据的正则表达式
实例
<?php
$string = "Match this string";
var_dump(filter_var($string, FILTER_VALIDATE_REGEXP,
array("options"=>array("regexp"=>"/^M(.*)/"))))
?>
代码的输出如下所示:
string(17) "Match this string"
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
Elements of Programming
Alexander A. Stepanov、Paul McJones / Addison-Wesley Professional / 2009-6-19 / USD 39.99
Elements of Programming provides a different understanding of programming than is presented elsewhere. Its major premise is that practical programming, like other areas of science and engineering, mus......一起来看看 《Elements of Programming》 这本书的介绍吧!