문제

Is there a chance to search in the preg_grep input with non case sensitive search?

$checkAuth = preg_grep("/CN=".$cn_name."/", $entries[0]["member"]);

The cn_name can be with upper and lower case, but it works only with the correct case sensitive name. I know, the preg_match can be used with an "i" like:

preg_match("/php/i", "PHP is the web scripting language of choice.")

but preg_match requires a string and is not working with a array.

도움이 되었습니까?

해결책

Just do

$checkAuth = preg_grep("/CN=".$cn_name."/i", $entries[0]["member"]);

preg_grep and preg_match both use PCRE patterns

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top