abstract:本文實(shí)例講述了php不使用copy()函數(shù)復(fù)制文件的方法。分享給大家供大家參考。具體如下:下面的代碼不使用php內(nèi)置的copy函數(shù),直接通過文件讀取寫入的操作方式復(fù)制文件<?php function copyfiles($file1,$file2){ $contentx =@file_get_contents($file1); $ope
本文實(shí)例講述了php不使用copy()函數(shù)復(fù)制文件的方法。分享給大家供大家參考。具體如下:
下面的代碼不使用php內(nèi)置的copy函數(shù),直接通過文件讀取寫入的操作方式復(fù)制文件
<?php function copyfiles($file1,$file2){ $contentx =@file_get_contents($file1); $openedfile = fopen($file2, "w"); fwrite($openedfile, $contentx); fclose($openedfile); if ($contentx === FALSE) { $status=false; }else $status=true; return $status; } ?>
更多關(guān)于php不使用copy()函數(shù)復(fù)制文件的方法請關(guān)注PHP中文網(wǎng)(www.miracleart.cn)其他文章!