php7 eregi 대체 preg_match

2024-01-10 19:39
3,152
0
0
0
본문
접기
[ ▼ 작성자 참고 Source ]
$str1 = 'test'; $pattern = "/test/i"; // i 플래그는 대소문자를 무시하도록 합니다. if (preg_match($pattern, $str1)) { echo "문자열에 'test'가 포함되어 있습니다."; } else { echo "문자열에 'test'가 포함되어 있지 않습니다."; }
본문
eregi는 대소문자를 무시하는 함수이며, php7에서는 eregi 함수를 지원하지 않습니다
대체 함수로 prege_match 함수를 사용하여 사용해야됩니다
0
0
로그인 후 추천 또는 비추천하실 수 있습니다.
댓글목록0