Validating
file_exists(“test.txt”);
is_file(“test.txt”);
is_dir(“/temp”);
Checking States
is_readable(“test.txt”);
is_writable(“test.txt”);
is_executable(“test.txt”);
Determining File Size
filesize(“test.txt”);
Getting Date information
fileatime(“test.txt”) //last accessed time
filemtime(“test.txt”) // last modified time
filectime(“test.txt”) // last changed time
Creating file and Delete
touch(“myfile.txt”)
unlink(“myfile.txt”)
Open file for writing, reading, appending
$fp = fopen(“test.txt”, “r”);
$fp = fopen(“test.txt”,”w”);
$fp = fopen(“test.txt”, “a”);




0 Comments on “File and Directory functions”
Leave a Comment