basename() : Returns the filename component from a path.
$path = "/directory1/index.html";
echo basename($path); // display: index.html
echo basename($path ,".html" ); // display: index
?>
file_exists() : Checks if a file or directory exists ot not.
echo file_exists("test.txt"); // returns True if exists, otherwise returns False
?>
rename() : Renames a file or directory.
rename("dir1","dir2"); // You can rename a file or a folder
?>
copy() : Copies a file.
copy("sourcefile.txt","destinationfile.txt");
?>
unlink() : Deletes a file.
unlink("file.txt"); // returns True if deleted successfully, False if not deleted.
?>
filesize() : Returns the size of the file.
echo filesize("file.txt"); // returns the size of file.txt in bytes, or False in failure.
?>
filetype() : Returns the file type.
echo filetype("file.txt"); // returns type: file.
//Possible types are: file, dir, link, block, char, fifo, unknown.
?>
is_readable() : Checks whether a file is readable, returns true if yes.
is_writable() : Checks whether a file is writeable, returns true if yes.
fileperms() : Returns the permissions of a file.
filemtime() : Returns the last modification time of a file, Display a number in second, to convert it to humain redable date format, use:
echo date("F d Y H:i:s", filemtime("test.txt")); // returns date format: September 03 2008 18:27:35
?>
If you have any question, or need more details or functions, post a comment here.