php copy 函數教程_PHP教程

來源:互聯網
上載者:User
下面來看看這款php copy 函數教程吧。

copy
( PHP 4中, PHP 5中)

複製-複製檔案

描述
布爾copy(字串$來源,字串$ dest [ ,資源$背景] )
使檔案的一個copy源dest 。

如果你想移動的檔案,請使用重新命名( )函數。

參數

來源
路徑的源檔案。

dest
目的地路徑。如果dest是一個網址,複製操作可能會失敗,如果封裝不支援覆蓋現有的檔案。

警告
如果目標檔案已經存在,它會被覆蓋。

背景
資源的有效範圍內建立stream_context_create ( ) 。


傳回值
返回TRUE或FALSE的成功失敗。

修改

版本說明
5.3.0時間方面的支援。
4.3.0來源和dest現在可能網址如果“開啟封裝”已啟用。見fopen ( )函數的更多細節。


執行個體

例如# 1copy( )的例子

$file = 'example.txt';
$newfile = 'example.txt.bak';

if (!copy($file, $newfile)) {
echo "failed to copy $file...n";
}
?>


http://www.bkjia.com/PHPjc/445489.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445489.htmlTechArticle下面來看看這款php copy 函數教程吧。 copy ( PHP 4中, PHP 5中) 複製-複製檔案 描述 布爾copy(字串$來源,字串$ dest [ ,資源$背景] ) 使...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.