Scan the qrcode to access this page from your phone.
Hi, Today I am going to talk about how to move files with php
There are two ways to do it.
First you have to copy that file you want to move to where you want and then delete the old copy.
Example:
<?php $file = 'folder1/example.txt'; $newfile = 'folder2/example.txt'; copy($file, $newfile); unlink(file); ?>
This one is easier than the first one.You have to give the path of the file that you want to move in the first parameter of the rename() function and give the new path for the file in the second parameter (give the path with the file name).
Example:
<?php $file = 'folder1/example.txt'; $newfile = 'folder2/example.txt'; rename($file,$newfile); ?>
eitai valo copy er ceye!