Search results
Just copy the old contents (if necessary), and write the new contents into a new file, then rename over the original file.
- File get contents
This function is similar to file(), except that...
- Fread
If you serve a file download over PHP with fread and...
- File exists
Return Values. Returns true if the file or directory...
- Readfile
Tip. A URL can be used as a filename with this function if...
- Fwrite
Note: . On systems which differentiate between binary and...
- File put contents
Parameters. filename. Path to the file where to write the...
- Fopen
The file must be accessible to PHP, so you need to ensure...
- Fgets
Parameters. stream. The file pointer must be valid, and must...
- File get contents
Learn how to use the rename () function to rename a file or directory in PHP. See the syntax, parameters, return value, and examples of the function.
18 lis 2012 · I want to rename picture filename (without extension) to old.jpg from this code. I have picture file in parent directory and the path is correctly. $old="picture"; $new="old.jpg"; rename($old , $new); or this codes. $old="\picture"; $new="\old.jpg"; rename($old , $new);
11 sty 2024 · Learn how to use PHP's rename() function to rename files and directories, with error handling, patterns, and best practices. This tutorial covers the basic usage, advanced features, and common pitfalls of renaming files in PHP.
Learn how to use the rename () function in PHP to rename or move a file or directory. See the syntax, parameters, and examples of this function.
30 cze 2023 · Learn how to use the rename () function in PHP to change file names or move files to different directories. See examples, tips and error handling with the error_get_last () function.
5 lut 2022 · Learn how to use the rename () function to rename or move files and folders in PHP with examples. Also, find out how to fix path issues with realpath () and rename multiple files with glob () and str_replace ().