프로덕션 서버에서 사용할 때 null을 반환하는 PHP 응용 프로그램에 일부 코드가 있지만 개발 서버에서 제대로 작동합니다. 다음은 코드 줄입니다.preg_match_all`u` 플래그는 무엇에 의존합니까?
// use the regex unicode support to separate the UTF-8 characters into an array
preg_match_all('/./us', $str, $match);
u
에 어떤 플래그가 종속됩니까? mb_string
이 활성화 및 비활성화되어 테스트되었으며 영향을 미치지 않는 것으로 보입니다.
내가 갖는 오류는
preg_match_all: Compilation failed: unknown option bit(s) set at offset -1
대한 추가 정보를 원하시면
이가 prodction 서버의 옵션 중 하나입니다 : 여기
'--with-pcre-regex=/opt/pcre'
및 pcre 섹션은
입니다. "PCRE가 UTF-8을 포함하도록 구축"하는 방법에 대한In order process UTF-8 strings, you must build PCRE to include UTF-8
support in the code, and, in addition, you must call pcre_compile()
with the PCRE_UTF8 option flag, or the pattern must start with the
sequence (*UTF8). When either of these is the case, both the pattern
and any subject strings that are matched against it are treated as
UTF-8 strings instead of strings of 1-byte characters.
모든 링크 나 팁 :
Picture.png http://img829.imageshack.us/img829/8524/pictureke.png
6,나는이 노트 @Wesley가 언급했다 믿습니다? 그것은 PCRE에 따라 pcretest -C
PCRE version 6.6 06-Feb-2006
Compiled with
UTF-8 support
Unicode properties support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
변수 또는 상수 값을 테스트하고 있습니까? 귀하의 예제 변수를 가지고, 나는 당신이 상상에 대해 당신이 dev에 살고 살고 있는지 확인해야한다고 생각합니다. – hakre
http://php.net/manual/en/reference.pcre.pattern.modifiers.php, 의견도 참조하십시오. –