易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关文档:

关于MemcacheDB PHP客户端的问题及解决办法

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 ......

搭建Windows下基于Eclipse 的 PHP 开发环境

集成配置
      在配置Eclipse之前,首先需要一个Apache+PHP的基础环境,
  可以装wampp或php home,它们都是集成化安装,比较方便,下载地址如下:
  wampp2.2
  php home
  
  建议装wampp2.2,集成Apache,MySQL,Perl,PHP。而且解压缩就可用,我就用它挺方便的。
  下面我就 ......

VisualSVN增加密码php修改页面

VisualSVN增加密码php修改页面
1.假设VisualSVN安装在 C:\Program Files\VisualSVN Server
2.下载并安装php windows版本,假设安装在c:\php
  可以到php官方网站下载 www.php.net
  附件中带的是 php-5.3.2-Win32-VC6-x86.zip
3.VisualSVN增加php支持
注意修改 "c:/php/php5apache2_2.dll" 为正确路径
C:\ ......

php 上传文件

//最好先建立一个 upload/public这个文件夹,以下是upload.php
<?php
/**
*********************************************
参数设定
*********************************************
**/
//最大上传文件大小
$MAX_SIZE = 20000000;
//设置Mine类型
$FILE_MIMES = array
('image/jpeg','image/jpg','image/gif ......

php开发环境设置

1: apache服务器安装.apache_2.0.59-win32-x86-no_ssl.msi。
修改conf\httpd.conf中的文件,修改位置为:
DocumentRoot  "c:/webpage"  设置虚拟目录 c:/webpage.
DirectoryIndex  index.html  index.html.var   index.php
==使apache服务器识别php的扩展名。
在<Directory "c:/pr ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号