WHAT A LAMP Rotating Header Image

Posts Tagged ‘fopen’

File and Directory functions

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”);

File operation in PHP

Open File
fopen() returns false when the file can not be openned.
if ($fp=fopen(“test.txt”, “w”)){
//do something
}
Close File
fclose($fp);