上都海奶茶馆 发表于 2017-3-29 10:16:16

PHP的preg_match正则表达式

  preg_match可验证一些正则表达式:

<?php
//phpinfo();
$str = test12346;
if (preg_match('/test/i', $str))
{
echo 'status ok';
} else {
echo 'status error';
}
?>
  在PHP手册中的preg_match函数介绍是,
  nt preg_match ( string pattern, string subject [, array matches [, int flags]] )
在 subject 字符串中搜索与 pattern 给出的正则表达式相匹配的内容。
页: [1]
查看完整版本: PHP的preg_match正则表达式