Amit Dhamu

Writes Code

Useful Folder & File Functions in PHP

/* Create File */
fopen("new-file.txt", "w");

/* Create Directory */
mkdir("path/to/new/folder");

/* Check If Directory Exists */
if(is_dir("path/to/folder")) {
    // Directory exists
}

/* Delete Directory  */
rmdir("path/to/folder");

/* Delete File */
unlink("path/to/file");

/* Move File */
rename("old_path/image.jpg", "new_path/image.jpg");


file / directory

← Select Nth Class of Element Toggle Text Function →