时间:2021-07-01 10:21:17 帮助过:5人阅读
$file="宋1.mp3.part1";
$file1="宋2.mp3.part1";
$file2="宋3.mp3.part1";
$fp = fopen($file, "a");
$fp1 = fopen($file1, "r");
$fp2 = fopen($file2, "r");
// if(!$fp1) echo "aa";
// return;
//fseek(fp, 0, SEEK_END);
$index=0;
while(!feof($fp1)){//测试文件指针是否到了文件结束的位置
$content=fread($fp1,10);
if(fwrite($fp,$content)==false)
echo "不能写入到文件 $filename";
$index++;
echo $index;
}
$index=0;
while(!feof($fp2)){//测试文件指针是否到了文件结束的位置
$content=fread($fp2,10);
fwrite($fp,$content);
$index++;
echo $index;
}
fclose($fp);
fclose($fp1);
fclose($fp2);
rename ($file, "a.mp3");
echo "ok";
?>
$str="宋1.txt";
$str=iconv("utf-8", "GBK", $str);//注释掉就会失败
$fp = fopen($str, "a");
if(fwrite($fp,"losasds")!==false) echo "ok";
else echo "fail";
fclose($fp);