PHPä¸è±æåæ¢çç½ç«æ¯å¦ä½åç
程序员文章站
2022-05-17 20:21:42
...
PHPä¸è±æåæ¢çç½ç«æ¯æä¹åçï¼
ç°å¨è¦åä¸ä¸ªå¤è´¸ç½ç«ï¼éè¦ä¸æåè±æ两个çæ¬ï¼ææ³é®é®ï¼æ¯åç¬å两个ç½ç«åºæ¥è¿æ¯åªåä¸ä¸ªï¼ç¶åä¸è±æä¹é´åæ¢ï¼
------解å³æ¹æ¡--------------------
å¤è¯è¨ç½ç«è§£å³æ¹æ¡ php
åè¨ï¼
å¤è¯è¨ç½ç«å¼åï¼éç¹çè¿æ¯å¨è§£å³è¯è¨ä¹é´çé®é¢ã
é£å¦ä½è§£å³è¿ä¸ªé®é¢å¢ï¼å¤§æ¦å°±åä¸æ¥èµ°ï¼
1.页é¢å¤è¯è¨
2.æ°æ®åºå¤è¯è¨
3.ç¨æ·è®¿é®è¯è¨ç»ä¸
1.页é¢å¤è¯è¨
éè¦èèçé®é¢ï¼
A.ç¨æ·ç»éæ¶åï¼èªå¨è¯å«å符ï¼è°ç¨ä¸åçè¯è¨å ï¼
B.ç¨æ·åæ¢ä¸åè¯è¨æ¶åï¼è°ç¨ä¸åçè¯è¨å ï¼
C.å¢å å¤è¯è¨åçç®å½ç»æï¼
页é¢å¤è¯è¨ä¹å°±æ¯å¤è§çå¤è¯è¨åï¼è¿éå¯ä»¥éç¨éæçè¯è¨å çæ¹å¼ã
设计æ¶åå°±åºè¯¥å æ¬languageçç®å½ï¼é对ä¸åè¯è¨æç¬ç«çåç®å½ã
å¦è±ælanguage/en ,ç®ä½ä¸ælanguage/gb,ç¹ä½ä¸ælanguage/b5 ï¼å¯ä»¥æ©å±å ¶ä»è¯è¨ï¼
æ¯ä¸ªç®å½ä¸å°±å å«äºå¯¹æ¯ä¸ªé¡µé¢çè¯è¨çæ¬ãéæ©è¯è¨çæ¬æ¶åå°±å¯ä»¥è°ç¨ç¸åºçæ¬çè¯è¨å ã
å ·ä½åæ³ï¼
0.å©ç¨jsè¯è¨ï¼è¯å«æµè§å¨è¯è¨ï¼å¨è°ç¨ä¸åçè¯è¨å .
1.language/en/global.lnæ¯é对è±æççå ¨å±è¯è¨å ã
2.global.ln å 容为ï¼
$title = "English webstie";
$charset = "UTF-8";
3.index.phpè°ç¨ï¼
require_once()
?>;
;
;
;$title;
;
;
;;
;
è¿æ ·éè¿æ©å±å°±å¯ä»¥å®ç°é¡µé¢çå¤è¯è¨å.
2.æ°æ®åºå¤è¯è¨
è¿ä¸ªèèçé®é¢ï¼
A.åå°å½å ¥æ°æ®çå¤è¯è¨åï¼
B.ç¨æ·å¨ä¸åçæ¬ä¸ï¼æ交çå 容ï¼å¦ä½ä¿åï¼
C.æä¾ä¸ç§è¯è¨å ï¼è¿æ¯æä¾è±æåç®ä½ï¼ç®ä½éè¿è½¬åæä¾ç¹ä½ï¼
æ°æ®åºå¤è¯è¨å°±æ¯è¾¾å°å¤è¯è¨å¨æ°æ®åºéé¢çç»ä¸ãå°±éè¦éç¨utf-8ç»ä¸ç¼ç ã
æ 论ä»ä¹è¯è¨çæåï¼é½ç»ä¸ä½¿ç¨utf-8æ¥åæ¾å°æ°æ®åºéé¢ãéç¨è¡¨å段æ¥è¡¨è¯
å±äºä»ä¹è¯è¨çæ¬çæåã
å ·ä½ï¼
A.对äºåå°æ·»å çé®é¢ï¼
1.åå°æ·»å æ¶åï¼å°±éè¦å¤è¯è¨åçå½å ¥ãå 建ç«ä¸ä¸ªä»¥utf-8ç¼ç çæ°æ®åºï¼å½å ¥è±æ/ç®ä½ï¼ç®ä½å¨éè¿è½¬å为ç¹ä½ï¼
å以utf-8ç¼ç æ¹å¼åäºæ°æ®åºä¸ã
2.建ç«ä»¥utf-8为ç¼ç ç表ç»æï¼importlanguageæ è¯å±äºä»ä¹è¯è¨çæ¬
ä½å¨æ个çæ¬ä¸ï¼å°±æç´¢å±äºè¿ä¸ªçæ¬çæåæ¥æ¾ç¤ºãå ¶ä»æåä¸æ¾ç¤ºã
DROP TABLE IF EXISTS `zz_importer`;
CREATE TABLE IF NOT EXISTS `zz_importer` (
`importID` int(11) NOT NULL auto_increment,
`importTime` date NOT NULL default '0000-00-00',
`improtfile` varchar(100) NOT NULL default '',
`importlanguage` varchar(100) NOT NULL default ''
PRIMARY KEY (`importID`)
) ENGINE=MyISAM DEFAULT CHARSET=uft-8;
3.ç®ä½è½¬åçç¹ä½ã
å©ç¨phpçiconv.æ¤è¿ç¨å¯¹äºlinux/unixææï¼å¯¹äºwindowsæ æã
iconv("GB2312","BIG5",$text);
4.å 为,charset = "utf-8",æ°æ®å°±é½æ¯ä»¥utf-8ç¼ç æ¹å¼åå¨ï¼
æ·»å æ°æ®æ¶å,è¦åå«ç¨en/gb/big5æ¥æ è¯è¯è¨çæ¬.
INSERT INTO `zz_importer` VALUES (,'', '', 'en');
INSERT INTO `zz_importer` VALUES (,'', '', 'gb');
INSERT INTO `zz_importer` VALUES (,'', '', 'big5');
B.对äºç¨æ·æ·»å çé®é¢ï¼
1.å设ä¸ç®ä½ä¸æä¸.ç¨æ·å 为页é¢å¤´ä¸ºUTF-8.åç¨æ·æµè§å¨ä¼ä»¥utf-8ç¼ç
æ¹å¼æµè§é¡µé¢ã
2.æ·»å çæ°æ®åºæ¬èº«ä»¥utf-8æ¹å¼åå¨ã
3.æ·»å æ°æ®æ¶å,è¦åå«ç¨gbæ¥æ è¯è¯è¨çæ¬
INSERT INTO `zz_importer` VALUES (,'', '', 'gb');
C.对äºç®ä½åç¹ä½æ¯åç¬æä¾è¿æ¯è½¬åé®é¢
åç¬æä¾ - æ¯è¾ç¬¦åå¤è¯è¨çæ å,çµæ´»æ§å¤§,对ISP没æç¹å«çè¦æ±ã
转åæä¾ - æ交é度ä¼åå½±å,åæ¶è¦ISPæä¾iconvçå½æ°æ¯æã
3.ç¨æ·è®¿é®è¯è¨ç»ä¸
A.å设ç¨æ·ç®ä½ä¸æçæ¶åï¼
;
ææè¯è¨çæ¬é½æ¯è¿æ ·ã
B.è°ç¨language/gbçè¯è¨å ã
C.æç´¢æ°æ®åºæè¯è¨å段为gbçæ°æ®ï¼å¹¶æ¾ç¤º
D.å½ç¨æ·æ交信æ¯ï¼åç §ä¸é¢æ°æ®åºå¤è¯è¨çBé®é¢ã
ç°å¨è¦åä¸ä¸ªå¤è´¸ç½ç«ï¼éè¦ä¸æåè±æ两个çæ¬ï¼ææ³é®é®ï¼æ¯åç¬å两个ç½ç«åºæ¥è¿æ¯åªåä¸ä¸ªï¼ç¶åä¸è±æä¹é´åæ¢ï¼
------解å³æ¹æ¡--------------------
å¤è¯è¨ç½ç«è§£å³æ¹æ¡ php
åè¨ï¼
å¤è¯è¨ç½ç«å¼åï¼éç¹çè¿æ¯å¨è§£å³è¯è¨ä¹é´çé®é¢ã
é£å¦ä½è§£å³è¿ä¸ªé®é¢å¢ï¼å¤§æ¦å°±åä¸æ¥èµ°ï¼
1.页é¢å¤è¯è¨
2.æ°æ®åºå¤è¯è¨
3.ç¨æ·è®¿é®è¯è¨ç»ä¸
1.页é¢å¤è¯è¨
éè¦èèçé®é¢ï¼
A.ç¨æ·ç»éæ¶åï¼èªå¨è¯å«å符ï¼è°ç¨ä¸åçè¯è¨å ï¼
B.ç¨æ·åæ¢ä¸åè¯è¨æ¶åï¼è°ç¨ä¸åçè¯è¨å ï¼
C.å¢å å¤è¯è¨åçç®å½ç»æï¼
页é¢å¤è¯è¨ä¹å°±æ¯å¤è§çå¤è¯è¨åï¼è¿éå¯ä»¥éç¨éæçè¯è¨å çæ¹å¼ã
设计æ¶åå°±åºè¯¥å æ¬languageçç®å½ï¼é对ä¸åè¯è¨æç¬ç«çåç®å½ã
å¦è±ælanguage/en ,ç®ä½ä¸ælanguage/gb,ç¹ä½ä¸ælanguage/b5 ï¼å¯ä»¥æ©å±å ¶ä»è¯è¨ï¼
æ¯ä¸ªç®å½ä¸å°±å å«äºå¯¹æ¯ä¸ªé¡µé¢çè¯è¨çæ¬ãéæ©è¯è¨çæ¬æ¶åå°±å¯ä»¥è°ç¨ç¸åºçæ¬çè¯è¨å ã
å ·ä½åæ³ï¼
0.å©ç¨jsè¯è¨ï¼è¯å«æµè§å¨è¯è¨ï¼å¨è°ç¨ä¸åçè¯è¨å .
1.language/en/global.lnæ¯é对è±æççå ¨å±è¯è¨å ã
2.global.ln å 容为ï¼
$title = "English webstie";
$charset = "UTF-8";
3.index.phpè°ç¨ï¼
require_once()
?>;
;
;
;
;
;
è¿æ ·éè¿æ©å±å°±å¯ä»¥å®ç°é¡µé¢çå¤è¯è¨å.
2.æ°æ®åºå¤è¯è¨
è¿ä¸ªèèçé®é¢ï¼
A.åå°å½å ¥æ°æ®çå¤è¯è¨åï¼
B.ç¨æ·å¨ä¸åçæ¬ä¸ï¼æ交çå 容ï¼å¦ä½ä¿åï¼
C.æä¾ä¸ç§è¯è¨å ï¼è¿æ¯æä¾è±æåç®ä½ï¼ç®ä½éè¿è½¬åæä¾ç¹ä½ï¼
æ°æ®åºå¤è¯è¨å°±æ¯è¾¾å°å¤è¯è¨å¨æ°æ®åºéé¢çç»ä¸ãå°±éè¦éç¨utf-8ç»ä¸ç¼ç ã
æ 论ä»ä¹è¯è¨çæåï¼é½ç»ä¸ä½¿ç¨utf-8æ¥åæ¾å°æ°æ®åºéé¢ãéç¨è¡¨å段æ¥è¡¨è¯
å±äºä»ä¹è¯è¨çæ¬çæåã
å ·ä½ï¼
A.对äºåå°æ·»å çé®é¢ï¼
1.åå°æ·»å æ¶åï¼å°±éè¦å¤è¯è¨åçå½å ¥ãå 建ç«ä¸ä¸ªä»¥utf-8ç¼ç çæ°æ®åºï¼å½å ¥è±æ/ç®ä½ï¼ç®ä½å¨éè¿è½¬å为ç¹ä½ï¼
å以utf-8ç¼ç æ¹å¼åäºæ°æ®åºä¸ã
2.建ç«ä»¥utf-8为ç¼ç ç表ç»æï¼importlanguageæ è¯å±äºä»ä¹è¯è¨çæ¬
ä½å¨æ个çæ¬ä¸ï¼å°±æç´¢å±äºè¿ä¸ªçæ¬çæåæ¥æ¾ç¤ºãå ¶ä»æåä¸æ¾ç¤ºã
DROP TABLE IF EXISTS `zz_importer`;
CREATE TABLE IF NOT EXISTS `zz_importer` (
`importID` int(11) NOT NULL auto_increment,
`importTime` date NOT NULL default '0000-00-00',
`improtfile` varchar(100) NOT NULL default '',
`importlanguage` varchar(100) NOT NULL default ''
PRIMARY KEY (`importID`)
) ENGINE=MyISAM DEFAULT CHARSET=uft-8;
3.ç®ä½è½¬åçç¹ä½ã
å©ç¨phpçiconv.æ¤è¿ç¨å¯¹äºlinux/unixææï¼å¯¹äºwindowsæ æã
iconv("GB2312","BIG5",$text);
4.å 为,charset = "utf-8",æ°æ®å°±é½æ¯ä»¥utf-8ç¼ç æ¹å¼åå¨ï¼
æ·»å æ°æ®æ¶å,è¦åå«ç¨en/gb/big5æ¥æ è¯è¯è¨çæ¬.
INSERT INTO `zz_importer` VALUES (,'', '', 'en');
INSERT INTO `zz_importer` VALUES (,'', '', 'gb');
INSERT INTO `zz_importer` VALUES (,'', '', 'big5');
B.对äºç¨æ·æ·»å çé®é¢ï¼
1.å设ä¸ç®ä½ä¸æä¸.ç¨æ·å 为页é¢å¤´ä¸ºUTF-8.åç¨æ·æµè§å¨ä¼ä»¥utf-8ç¼ç
æ¹å¼æµè§é¡µé¢ã
2.æ·»å çæ°æ®åºæ¬èº«ä»¥utf-8æ¹å¼åå¨ã
3.æ·»å æ°æ®æ¶å,è¦åå«ç¨gbæ¥æ è¯è¯è¨çæ¬
INSERT INTO `zz_importer` VALUES (,'', '', 'gb');
C.对äºç®ä½åç¹ä½æ¯åç¬æä¾è¿æ¯è½¬åé®é¢
åç¬æä¾ - æ¯è¾ç¬¦åå¤è¯è¨çæ å,çµæ´»æ§å¤§,对ISP没æç¹å«çè¦æ±ã
转åæä¾ - æ交é度ä¼åå½±å,åæ¶è¦ISPæä¾iconvçå½æ°æ¯æã
3.ç¨æ·è®¿é®è¯è¨ç»ä¸
A.å设ç¨æ·ç®ä½ä¸æçæ¶åï¼
;
ææè¯è¨çæ¬é½æ¯è¿æ ·ã
B.è°ç¨language/gbçè¯è¨å ã
C.æç´¢æ°æ®åºæè¯è¨å段为gbçæ°æ®ï¼å¹¶æ¾ç¤º
D.å½ç¨æ·æ交信æ¯ï¼åç §ä¸é¢æ°æ®åºå¤è¯è¨çBé®é¢ã
声æï¼æ¬æå 容ç±ç½åèªåè´¡ç®ï¼çæå½åä½è ææï¼æ¬ç«ä¸æ¿æ ç¸åºæ³å¾è´£ä»»ãå¦æ¨åç°ææ¶å«æè¢ä¾µæçå 容ï¼è¯·èç³»admin@php.cnæ ¸å®å¤çã
ç¸å ³æç«
ç¸å ³è§é¢