int eregi(string pattern, string string, [array regs]);
eregi()函数在pattern指定的整个字符串中搜索string指定的字符串,。搜索不区分大小写。 Eregi()在检查字符串的有效性时特别有用。
可选的输入参数regs包含一个由正则表达式中的括号分组的所有匹配表达式的数组。
<?php $password="abc"; if (! eregi ("[[:alnum:]]{8,10}", $password)) { print "Invalid password! Passwords must be from 8 - 10 chars"; } else { print "Valid password"; } ?>
这将产生以下输出-
链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-eregi.html
来源:LearnFk无涯教程网
Invalid password! Passwords must be from 8 - 10 chars
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)