|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-05-12 11:00 UTC] ilia at prohost dot org
rename() function can be used to rename files a user has no access to according to safe_mode.
Ex.
touch test
<?php rename('test', 'test2'); ?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 05:00:01 2025 UTC |
mkdir test; ls -ld test drwxr-xr-x 2 forum forum 4096 May 12 11:33 test ls -l a.php -rw-rw-rw- 1 www www 44 May 12 10:57 a.php a.php: <?php rename('test', 'test3'); ?> Script runs without errors, end result: ls -ld test3 drwxr-xr-x 2 forum forum 4096 May 12 11:35 test3mkdir test; ls -ld test drwxr-xr-x 2 forum forum 4096 May 12 11:33 test ls -l a.php -rw-rw-rw- 1 www www 44 May 12 10:57 a.php a.php: <?php rename('test', 'test3'); ?> Script runs without errors, end result: ls -ld test3 drwxr-xr-x 2 forum forum 4096 May 12 11:35 test3 It works with files as well as directories.