phpÖÐfopen²»ÄÜ´´½¨ÖÐÎÄÎļþÃûÎļþµÄÎÊÌâ
֮ǰÍøÒ³µÄchartsetÓõÄÊÇutf-8£¬ÎļþÒ²ÓÃutf-8£¬È»ºóÓÃfopen()´´½¨Ò»¸öÖÐÎÄÎļþÃûµÄÎļþʱÎÊÌâ¾Í³öÀ´ÁË£¬ÎļþÃû¶¼ÊÇÂÒ
Â룡
²é¿´Á˺ܶàÎĵµÊÔÁ˲»ÉÙ·½·¨¶¼½â¾ö²»ÁË£¬±¾À´Ïë×ÅÓñðµÄ·½·¨ÈƹýÕâ¸öÎÊÌ⣬ºöÈ»ÄÔ×ÓÀïÉÁ¹ýWindowsĬÈϵÄÎÄ×Ö±àÂëÊÇansi£¬È»ºóÔÙ
baiduÁËһϣ¬Ö¤ÊµÁËÕâµã£¬ËùÒÔÎÒµÄÍøÒ³Ò²Ó¦¸ÃÊÇansi±àÂë²ÅÄÜʹ´´½¨µÄÎļþÃû²»»áÊÇÂÒÂë¡£
½ÓמÍ×ÅÊÖÑéÖ¤£¬°ÑÍøÒ³¶¼ÓÃansi±£´æ£¬È¥µôchartsetÓï¾ä£¬¹ûÈ»okÁË£¬µ«ÊÇÍøÒ³µÄÄÚÈݾͳÉÂÒÂëÁË£¬ºóÀ´ÏëÆð£¬Õâ¸öÍøÒ³»¹include
Á˱ðµÄÍøÒ³£¬°ÑincludeµÄÍøÒ³Ò²¸Ä³Éansi±£´æ£¬¹þ¹þÍòÊÂok
±à³ÌÕâ¸ö¹¤×÷ÕæµÄºÜ¿¿»ýÀÛ£¬Èç¹ûÎÒÒÔǰû¿´¹ýWindowsĬÈϱàÂëÊÇansi£¬ÄÇÕâ¸öÎÊÌâ¾Í²»ÖªºÎÄêºÎÔ²ÅÄܽâ¾öÁË
ps:<
meta
content
="text/html;
charset=utf-8"
http
-equiv
="Content-type"
>
Õâ¸ömeta±ê¼ÇÒ»¶¨Òª·ÅÔÚ<title></title>֮ǰ²ÅÓÐЧµÄ
ºóÀ´ÓÖÏëµ½ÁËÒ»¸ö¸üºÃµÄ½â¾ö·½·¨£¬ÍøÒ³»¹ÊÇÓÃutf-8±àÂëºÍ±£´æ£¬Ö»ÊÇfopen£¨£©ÀïµÄÎļþÃû²Î
Êýµ¥¶À¸øËü±àÏÂÂë¾ÍÐУ¬phpÓÐiconv£¨£©
Õâ¸ö¸Ä»»±àÂëµÄ³ÌÐò£¬°Ñutf-8ת³É
gb2312¾Í¿ÉÒÔ±ÜÃâÖÐÎÄÎļþÃûΪÂÒÂëÁË
==================================
test.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>±êÌ⣺{title}</title>
</head>
<body>
<b>´ËÐÂÎŵÄÄÚÈÝ£º</b>{content}
</body>
</html>
test.php
<?php
//ʵ¼ÊÓ¦ÓÃÖкܿÉÄÜÊDzéѯÊý¾Ý¿âÈ¡ÄÚÈÝ¡£
$rows = array(array("Ìæ»»±êÌâ1","Ìæ»»ÄÚÈÝ1"),array("Ìæ»»±êÌâ2","Ìæ»»ÄÚÈÝ2"));
$filename = "tmp.htm";
foreach($rows as $id => $val){
$title = $val[0];
$content = $val[1];
$pagename = "²âÊÔ".$id.".html";
//¶ÔÎļþÃûµÄ±àÂë
Ïà¹ØÎĵµ£º
ÏÖÔÚÖ÷Á÷µÄÍøÕ¾¿ª·¢ÓïÑÔÎÞÍâºõasp¡¢php¡¢asp.net¡¢jspµÈ¡£
ÍøÒ³´Ó¿ªÊ¼¼òµ¥µÄhmtlµ½¸´ÔӵķþÎñÓïÑÔ£¬×ß¹ýÁË10¶à¸öÄêÍ·£¬¸÷ÖÖ¼¼Êõ²ã³ö²»Çµ¥¸öµÄÖ÷Á÷¼¼ÊõÒ²ÔÚ²»¶Ï·Ðµİ汾£¬ÏÖÔÚ·ÖÎöϸ÷ÖÖÓïÑÔµÄÇø±ð¡¢ÓÅÊÆ¡¢ÁÓÊÆ¡¢¿ª·¢×¢ÒâÊÂÏ
HTML:µ±È»ÕâÊÇÍøÒ³×î»ù±¾µÄÓïÑÔ,ÿһ¸ö·þÎñÆ÷ÓïÑÔ¶¼ÐèÒªËüµÄÖ§³Ö,Ҫѧϰ,Õâ¸ö¿Ï¶¨ÊÇ¿ªÊ¼ ......
ÿ¸öÈ˵Äѧϰ·½Ê½²»Í¬£¬Ð´ÕâƪÎÄÕµÄÄ¿µÄÊÇ·ÖÏíÒ»ÏÂ×Ô¼ºµÄѧϰ¹ý³Ì£¬½ö¹©²Î¿¼£¬²»ÒªÒ»Î¶µÄÓñðÈ˵Äѧϰ·½·¨£¬ÕÒ¶Ô×Ô¼ºÓÐÓõÄѧϰ·½Ê½
¡¡¡¡¾³£ÔÚijЩÂÛ̳ºÍQQȺÀï¿´µ½Ò»Ð©ÅóÓÑ»áÎÊ“ÔõÑù²ÅÄÜѧºÃPHP£¬ÔõÑù²ÅÄÜѧºÃ***ÓïÑÔ ”£¬µ«±ðÈ˻شð×î¶àµÄÊÇ£º´Ó×òµ¥”µÄ¿ªÊ¼¡£
¡¡¡¡Õâ¸ö¼òµ¥Ò²ÐíÕæµÄ²»¼òµ ......
2008 Äê 12 ÔÂ 29 ÈÕ
ÏñÆäËûÓïÑÔÒ»Ñù£¬¿ª·¢ÈËÔ±¿ÉÒÔÓà PHP ±àд³ö¸÷ÖÖÖÊÁ¿¼¶±ðµÄ´úÂ롣ѧϰÁ¼ºÃµÄ±à³ÌÏ°¹ßÄܹ»Ìá¸ß´úÂëÖÊÁ¿ºÍЧÂÊ¡£
¸ù¾Ý¾ßÌåµÄÇé¿ö£¬Ò»°ãµÄ¿ª·¢ÈËÔ±ÍùÍù±ÈÓÅÐãµÄ¿ª·¢ÈËÔ±µÄЧÂÊµÍ 10%~20%¡£ÓÅÐãµÄ¿ª·¢ÈËÔ±µÄЧÂʸü¸ß£¬ÒòΪËûÃÇÓµÓзḻµÄ¾ÑéºÍÁ¼ºÃµÄ±à³ÌÏ°¹ß¡£²»Á¼µÄ±à³ÌÏ°¹ß½«»áÓ°Ï쵽ЧÂÊ¡£±¾ÎÄͨ¹ýÕ¹ ......
Ò»¡¢ÎÊÌâÆðÔ´
ÉÔ´óһЩµÄÍøÕ¾£¬Í¨³£¶¼»áÓкü¸¸ö·þÎñÆ÷£¬Ã¿¸ö·þÎñÆ÷ÔËÐÐ×Ų»Í¬¹¦ÄܵÄÄ£¿é£¬Ê¹Óò»Í¬µÄ¶þ¼¶ÓòÃû£¬¶øÒ»¸öÕûÌåÐÔÇ¿µÄÍøÕ¾£¬Óû§ÏµÍ³ÊÇͳһµÄ£¬¼´Ò»Ì×
Óû§Ãû¡¢ÃÜÂëÔÚÕû¸öÍøÕ¾µÄ¸÷¸öÄ£¿éÖж¼ÊÇ¿ÉÒԵǼʹÓõġ£¸÷¸ö·þÎñÆ÷¹²ÏíÓû§Êý¾ÝÊDZȽÏÈÝÒ×ʵÏֵģ¬Ö»ÐèÒªÔÚºó¶Ë·Å¸öÊý¾Ý¿â·þÎñÆ÷£¬¸÷¸ö·þÎñÆ÷ͨ¹ýͳһ½Ó
......
cache ʹÓãº
cacheÅäÖãº
$smarty->cache_dir = "/caches/"; //»º´æĿ¼
$smarty->caching = true; //¿ªÆô»º´æ,ΪflaseµÄʱºî»º´æÎÞЧ
$sma ......