php基础应用:php批量转换文件编码
	
    
    
	遍历目录文件,替换编码部分,删除原文件,再重新转码原文件内容,重新生成新文件。
function explorerdir($sDir){
    
    static $aTempArr=array();
    $dp=opendir($sDir);
    while ($sFileName = readdir($dp)){
        
        if ($sFileName !='.' && $sFileName !='..'){  
            
            $sPath=$sDir."/" . $sFileName; 
            if ( is_dir($sPath)){
                
                explorerdir($sPath);   
            } else  {
                
//                $filetime=date("Y-m-d H:i:s",filectime("$path")); 
//                $fp=$path.",".$filetime;
                $fp=$sPath;
                $aTempArr[]=$fp;
            }
       }
    }
    closedir($dp);
    return $aTempArr;
}
$aFiles = explorerdir("D:/wamp/www/dedecms/templets/default");
foreach($aFiles as $iKey => $sFiles) {
    
    $sContent = file_get_contents($sFiles);
    $sContent = str_ireplace('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />', '<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />', $sContent);    
    $sContent = iconv("UTF-8", "gb2312", $sContent);
     unlink($sFiles);
    file_put_contents($sFiles, $sContent);
    unset($sContent);
}
 
原贴地址:http://topic.csdn.net/u/20100407/10/b5fe2152-d5b2-42a5-aa3f-cf6c499af2f1.html
    
     
	
	
    
    
	相关文档:
        
    
    二分钟: 建立一个 CodeIgniter 网站
用CI建一个网站很容易。 这一章很短,解释了用CI制作网站时发生了些什么,哪些文件被创建,让我们来瞧一瞧:
. 创建网站需要什么软件?
. 安装 CI 文件: 一个简单的下载和解压缩操作
. CI 的基本设置: 有哪些文件夹及它们是如何组织的
. CI 安装时默认的控制器和视图
. 一些简单的 ......
	
    
        
    
    分析网站结构
既然我们已经安装 CI ,我们开始了解它如何工作。
读者已经知道 CI 实现了MVC式样。 通过对目录和文件的内容进行分类, 而不是让代码大块大块地纠集在一起。
这一章,我们将会对 MVC 理论做个简短的介绍, 然后再介绍 CI 的MVC实现方式。特别地,要了解那些目录和文件如何互相交换信息?网站结构是怎样的?以 ......
	
    
        
    
    http://blog.developers.api.sina.com.cn/?p=264
最近MemcacheDB邮件列表和研发部那边同事报告PHP的memcache客户端php-memcache经常出 现断连接的问题:
PHP Notice:  Memcache::get(): Server ………. (tcp 11211) failed with: Failed reading line from stream (0) with pecl-memcache 3.*
&h ......
	
    
        
    
    php config
1.安装Apache2.2
2.安装php5.2(注意选择所有的库文件)
3.将phpMyAdmin解压,拷贝至Apache2.2\htdocs\phpmyadmin(该路径可以自由改变)下。
4.修改配置文件:
 1)修改php.ini
  具体操作:
  extension_dir = "C:\Program Files\PHP\ext"  (536)
  extension=php ......
	
    
        
    
    用户定义的类,也是学好 PHP 所必备的条件之一。而 PHP 的类,和其它的面向对象语言比较起来,还算蛮单纯的。PHP 只有类别 (class)、方法 (method)、属性、以及单一继承 (extensions) 等。对不习惯使用 C++、Java、Delphi 等面向对象语言来开发程序的用户,不妨先阅读一下有关面向对象概念的书,相信可以带来许多的收获。
 ......