File::moveFile
Move (rename) a file
Description
public void File::moveFile( string $from, string $to )
Moves $from to $to with rename(). Nothing happens when $from does not exist.
Arguments
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $from | string | Source file | |
| $to | string | Destination file |
Example
Controller
use Fegg\Tool\File;
$file = new File();
$file->moveFile('path/to/foo.txt', 'path/to/bar.txt');