PHP ʖ²ἯTH
º/A
Ղ 2. ¼̳̼/TD
ʵӃµĽű¾
?php echo $_SERVER["HTTP_USER_AGENT"];?
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
=ד 2-3. ;Ӄ phpinfo() 4ϔʾ˹ӐԤ¶¨ҥ±䁿
?php phpinfo();?
=ד 2-4. ½ṹ¿ؖƼ/A ӫº¯ʽµĊ¹Ӄ
?php if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) {echo "You are using Internet Explorer br / ";}?
¸ýű¾µĊ䳶¿Ʉ܊ǣº
You are using Internet Explorer br /
=ד 2-5. »캍 HTML º͠PHP ģʽ
?php if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) {? h3 strstr must have returned true /h3 center b You are using Internet Explorer /b /center ?php} else {? h3 strstr must have returned false /h3 center b You are not using Internet Explorer /b /center ?php}?
¸ýű¾µĊ䳶¿Ʉ܊ǣº
h3 strstr must have returned true /h3 center b You are using Internet Explorer /b /center
º/A
ưµ㼯A
ɏһ¼¶