PHP ftp_rename() 函數
PHP ftp_rename() 函數

定義和用法
ftp_rename() 函數重命名 FTP 服務器上的文件或目錄。
如果成功,該函數返回 TRUE。如果失敗,則返回 FALSE。
語法
ftp_rename(ftp_connection,from,to)
參數 | 描述 |
---|---|
ftp_connection | 必需。規定要使用的 FTP 連接。 |
from | 必需。規定要重命名的文件或目錄。 |
to | 必需。規定文件或目錄的新名稱。 |
實例
<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
ftp_rename($conn,"oldname.txt","newname.txt");
ftp_close($conn);
?>
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
ftp_rename($conn,"oldname.txt","newname.txt");
ftp_close($conn);
?>

相關文章
- PHP EOF(heredoc) 使用說明
- PHP 字符串
- PHP 命名空間 namespace
- PHP 面向對象
- PHP date() 函數
- PHP JSON
- PHP array_diff_ukey() 函數
- PHP array_map() 函數
- PHP array_rand() 函數
- PHP array_reduce() 函數
- PHP array_search() 函數
- PHP array_uintersect_assoc() 函數
- PHP arsort() 函數
- PHP compact() 函數
- PHP end() 函數
- PHP rsort() 函數
- PHP shuffle() 函數
- PHP usort() 函數
- PHP FTP 函數
- PHP 5 Math 函數