방문자중에 익스8 출력문제.... 정보
방문자중에 익스8 출력문제....본문
visit.lib 에서
else if(preg_match("/msie 7.0[0-9]*/", $agent)) { $s = "MSIE 7.0"; }
else if(preg_match("/msie 8.0[0-9]*/", $agent)) { $s = "MSIE 8.0"; }
이렇게 했는데
방문자 브라우저 표시가 익스8.0은 출력이 안되는데
고수님들의 답변 부탁요...
else if(preg_match("/msie 7.0[0-9]*/", $agent)) { $s = "MSIE 7.0"; }
else if(preg_match("/msie 8.0[0-9]*/", $agent)) { $s = "MSIE 8.0"; }
이렇게 했는데
방문자 브라우저 표시가 익스8.0은 출력이 안되는데
고수님들의 답변 부탁요...
댓글 전체
$agent 값을 출력해보면 어떤 문자열을 사용해야하는지 금방 알 수 잇을텐데요
ie8 agent 문자열을 검색하는 방식인데 문자열중에 ie8은
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322)
상기와 같이 출력됩니다. 따라서 ie6도 문자열에 존재 하므로 재되로 되지 않더군요.
해결방법은 순서를 바꾸셔서 우선순위를 바꾸세요.
else if(preg_match("/msie 8.0[0-9]*/", $agent)) { $s = "MSIE 8.0"; }
else if(preg_match("/msie 6.0[0-9]*/", $agent)) { $s = "MSIE 6.0"; }
else if(preg_match("/msie 7.0[0-9]*/", $agent)) { $s = "MSIE 7.0"; }
MSIE 8.0 : 이건 ie8의 고유존재 값이닌깐요.
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322)
상기와 같이 출력됩니다. 따라서 ie6도 문자열에 존재 하므로 재되로 되지 않더군요.
해결방법은 순서를 바꾸셔서 우선순위를 바꾸세요.
else if(preg_match("/msie 8.0[0-9]*/", $agent)) { $s = "MSIE 8.0"; }
else if(preg_match("/msie 6.0[0-9]*/", $agent)) { $s = "MSIE 6.0"; }
else if(preg_match("/msie 7.0[0-9]*/", $agent)) { $s = "MSIE 7.0"; }
MSIE 8.0 : 이건 ie8의 고유존재 값이닌깐요.