Quantcast
Channel: snippet Feed
Viewing all articles
Browse latest Browse all 29

How to rename file in PHP?

$
0
0

If you want to rename a file in PHP you can use the rename function. The syntax of the rename function is same as that of the UNIX mv(move) command. The general syntax is:

rename('/pathA/old_file_name', '/pathB/new_file_name');

e.g.

rename('/tmp/data.log', '/tmp/data1.log');


Viewing all articles
Browse latest Browse all 29

Trending Articles