function find_langue()
) P: t) @* i4 K, ?% _{5 `6 s/ u3 o7 n$ c
global $HTTP_ACCEPT_LANGUAGE;
7 G p7 |% {: D0 Q- N3 f$ D $langueary=explode(",",$HTTP_ACCEPT_LANGUAGE);' H+ f- D+ P* P1 `7 W2 I
$lg="";
) L6 |9 z& Y" w8 [6 F/ Q1 Y4 V for($i=0;$i<count($langueary);$i++)
Z6 K8 ]- Q2 J9 t {, G% R8 m. `$ J0 e- I
switch(substr($langueary[$i],0,2))4 ?& n$ @" f# v% L6 p5 ]5 Z
{
# i c- R1 R! D9 y. N! X case "zh":2 w, b7 S0 p! Y3 a& z# U1 P
$lg = "zh";) L' O" [) ^0 U* i- Z2 l6 [
}) g+ c$ j9 y7 Q& d
} {7 g! w5 K: K& p
if($lg!="zh" )* ^# a: N+ t+ F7 r) d
$lg = "en";// $lg="en";% K( d2 [. U* h m9 ]* ?, i; U
/ _; F/ K. c: U& u9 ` return $lg;
. s7 q. R" K& S1 f}- M' F: y! ?/ N; t
9 H# B8 x% q. E- [6 U4 Z. [3 j0 D, g. U
$lg=find_langue();
1 n' f( s% N0 c9 Mif($lg=="zh" )# ]* p, i+ \7 Y, h
看中文首頁
3 _ C$ C6 ^# o" }2 ?# Q) T" |: Q. {. u- I" ~' s8 H2 r$ m7 q
[ Last edited by befree on 2004-10-22 at 03:59 ] |