mnl*_*her 1 php case-sensitive preg-match
是否有机会使用非区分大小写的搜索来搜索preg_grep输入?
$checkAuth = preg_grep("/CN=".$cn_name."/", $entries[0]["member"]);
Run Code Online (Sandbox Code Playgroud)
cn_name可以是大写和小写,但它只能使用正确的区分大小写的名称.我知道,preg_match可以和"i"一起使用,如:
preg_match("/php/i", "PHP is the web scripting language of choice.")
Run Code Online (Sandbox Code Playgroud)
但是preg_match需要一个字符串而不使用数组.
做就是了
$checkAuth = preg_grep("/CN=".$cn_name."/i", $entries[0]["member"]);
Run Code Online (Sandbox Code Playgroud)
preg_grep并且preg_match都使用PCRE模式
| 归档时间: |
|
| 查看次数: |
4181 次 |
| 最近记录: |