function find_langue()
, T8 ^1 w' l9 b3 H, R0 z& X6 U8 p! o1 h{) _. ~; s* e- s, d4 |! C2 c
global $HTTP_ACCEPT_LANGUAGE;" ^, N( u8 G( H* n5 x
$langueary=explode(",",$HTTP_ACCEPT_LANGUAGE);
, |" c3 X3 k' } ~' \7 c $lg="";, N( n; V3 ~# ~: D
for($i=0;$i<count($langueary);$i++)
9 k' W- d1 p) ]% o* Y {
/ d8 v$ e$ {- \1 z switch(substr($langueary[$i],0,2))
0 ~! ]" q5 R6 \% D7 g4 h' @, }' E {/ s% t7 k& n/ E. y+ Y/ R# E* x
case "zh":! f% O: y% E" e( I$ p* e7 d
$lg = "zh";
$ B- r7 ^' g& X2 B& ?4 k2 _ }2 ]" ` ]4 s3 b8 a) t1 k L1 {0 m5 N
}- a* d. I/ }0 [/ {& o @$ M/ l
if($lg!="zh" )' D: E* b* _6 o3 w6 W
$lg = "en";// $lg="en";% ?( M4 ]$ B5 ?1 R' ]4 s
# b; |' Z; G7 X2 y. u4 W return $lg;
6 a3 g0 [9 _) L, j! ], }4 T}
" Z# G5 V8 B) ~4 Y) d/ q
; a5 `" F9 B/ D$lg=find_langue();( U+ j: i* B8 D5 n
if($lg=="zh" )
% Y$ T; x' n/ Q$ e, Z; g: P 看中文首頁 M" Y0 T7 Y# i5 {0 X( f
" G6 b, j+ ~! i
[ Last edited by befree on 2004-10-22 at 03:59 ] |