sanders_yao
版主
  
or2 =333
UID 30286
精华
0
积分 11774
帖子 4958
金钱 11771 喜悦币
威望 0
人脉 3
阅读权限 100
注册 2004-7-23 来自 北京 菜户营
状态 离线
|
[推荐阅读] 求一个第三方网页获取内容的问题~
function foo($dir, $target){
$dir = str_replace('\\', '/', $dir);
$fp = false;
if(!is_dir($dir)){
return false;
}
$dir = preg_replace('~([^/])$~', '\\1/', $dir);
$files = glob("{$dir}*");
foreach($files as $file){
if(is_file($file) && $content = @file_get_contents($file)){
if(false === $fp && false === $fp = @fopen(str_replace('\\', '/', $target), 'a')){
return false;
}
fwrite($fp, $content);
}
}
if(is_resource($fp)){
fclose($fp);
}
return true;
}
|  最近写的一些代码都会在以下地址发布,有兴趣的来批:
http://www.phpx.com/happy/thread-131368-1-1.html |
|