Contoh Show <?php rename("images","pictures"); rename("/test/file1.txt","/home/docs/my_file.txt"); ?> Definisi dan PenggunaanFungsi Syntax
Nilai Parameter
Detail Teknis
<Lengkap PHP Filesystem Referensi Definisi dan PenggunaanThe rename() fungsi mengganti nama file atau direktori. Fungsi ini mengembalikan TRUE pada keberhasilan, atau FALSE pada kegagalan. Sintaksisrename(oldname,newname,context)
Contoh<?php <Lengkap PHP Filesystem Referensi Contoh <?php rename("images","pictures"); rename("/test/file1.txt","/home/docs/my_file.txt"); ?> Definisi dan PenggunaanFungsi Syntax
Nilai Parameter
Detail Teknis
Definisi dan PenggunaanFungsi Syntax
Nilai Parameter
Detail Teknis
Contoh <?php // Hubungkan dan login ke server FTP $ftp_server = "ftp.example.com"; $ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server"); $login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass); $old_file = "oldfile.txt"; $new_file = "newfile.txt"; // Ganti nama $old_file menjadi $new_file if (ftp_rename($ftp_conn, $old_file, $new_file)) { echo "Renamed $old_file to $new_file"; } else { echo "Problem renaming $old_file to $new_file"; } // Tutup koneksi ftp_close($ftp_conn); ?> (PHP 4, PHP 5, PHP 7, PHP 8) rename — Renames a file or directory Descriptionrename(string Parametersfrom The old name.
to The new name.
context A context stream resource. Return Values Returns ExamplesExample #1 Example with rename()
See Also
andrew at 21cv dot co dot uk ¶ 12 years ago
("/folder/file.ext", "newfile.ext");?> ben at indietorrent dot org ¶ 7 years ago
mike ¶ 8 years ago
pcdinh at phpvietnam dot net ¶ 13 years ago
michael-nospam at sal dot mik dot hyperlink dot net dot au ¶ 22 years ago
Whooptydoo ¶ 14 years ago
Martin Pelletier ¶ 11 years ago
php at froghh dot de ¶ 16 years ago
php at stock-consulting dot com ¶ 16 years ago
sophie at sitadelle dot com ¶ 18 years ago
andrew at iwebsolutions dot co dot uk ¶ 13 years ago
$return_val == 0) {
Eric (Themepark.com) ¶ 15 years ago
bcag2 at free dot fr ¶ 9 years ago
=iconv("UTF-8", "CP1252", "C:\\wamp\\www\\tést.txt"); tomfelker at gmail dot com ¶ 17 years ago
David Thole (root at thedarktrumpet.com) ¶ 15 years ago
php-public at macfreek dot nl ¶ 16 years ago
tbrillon at gmail dot com ¶ 16 years ago
dev at islam-soft dot com ¶ 15 years ago
eregi("\.$ext1",$file)) { # Look at only files with a pre-defined extension ddoyle [at] canadalawbook [dot] ca ¶ 17 years ago
Robert ¶ 8 years ago
= 'testFile.txt'; PHP at Drarok dot com ¶ 16 years ago
lord dot dracon at gmail dot com ¶ 4 years ago
tomv ¶ 5 years ago
mike at mbfisher dot com ¶ 7 years ago
Morteza ¶ 12 years ago
getDirectory( $path = '.', $level = 0 ){$ignore = array( 'cgi-bin', '.', '..' );$dh = @opendir( $path ); pearcec at commnav dot com ¶ 21 years ago
|