get delete folder in php

Solutions on MaxInterview for get delete folder in php by the best coders in the world

showing results for - "get delete folder in php"
Mae
07 Jan 2021
1function deleteDirectory($dir) {
2    if (!file_exists($dir)) {
3        return true;
4    }
5
6    if (!is_dir($dir)) {
7        return unlink($dir);
8    }
9
10    foreach (scandir($dir) as $item) {
11        if ($item == '.' || $item == '..') {
12            continue;
13        }
14
15        if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) {
16            return false;
17        }
18
19    }
20
21    return rmdir($dir);
22}
23
Gianni
19 Mar 2020
1$dirPath = "../images/productimages/$productid";
2	if (is_dir($dirPath)) {
3		shell_exec("rm -rf " . $dirPath);
4		rrmdir($dirPath);
5	}
6
7// call function
8
9function rrmdir($src) {
10    $dir = opendir($src);
11    while(false !== ( $file = readdir($dir)) ) {
12        if (( $file != '.' ) && ( $file != '..' )) {
13            $full = $src . '/' . $file;
14            if ( is_dir($full) ) {
15                rrmdir($full);
16            }
17            else {
18                unlink($full);
19            }
20        }
21    }
22    closedir($dir);
23    rmdir($src);
24}
25
26
Catalina
10 Feb 2020
1rmdir ( string $dirname , resource $context = ? ) : bool
queries leading to this page
how to remove php folderphp how to delete a folderhow to delete directory in phpdelete a folder phpremove directory in phpdelete directory in phpphp delete files in dirdelete folder from path phphow to delete folder using phphow to uninstall php in a folderif directory exists remove it phpphp delete a file from directorydelete file from directory phpdelete directory with content phpdelte folder in phpphp delete file from current directoryrm php folderfolder 3a 3adelete phpdelete folder and files in phpphp delete files in directoryphp delete folder and all contentsdelete a file from a folder phpdelete dir function phpphp delete file from directoryremove foldr in phpphp delete 2a folder and filesdelete file in directory in phpremove folder in phpphp delete direcotryhow to delete folder with contents in phpphp remove a folderdelete folder and contents phpdelete file in folder php scriptphp delete a folderphp delete directoryphp remove from folderphp delete file from folderremove folder from directory phpphp remove directory and contentsdelete file or folder in phpphp code to delete partiular folderdelete folder files phphow to delete folder in php codephp remove folder and all filesremove whole directory php with filesphp delete files from directoryhow to delete folder with file in phpdelete folder phphwo to delete folder in phphow to delete a file from a folder in phpphp rmdirphp script delete folderdelete folder and its contents phphow to remove folder in phpremove directory with files in it in phpphp delete directory and fileshow to do rmdir in phpdelete folder and all contents phpphp delete folder with contentsphp remove directory with files folders forciblydelete a folder in phpphp delete direphp delete file in directoryhow to delete files from folder in phpremove directory phphow to delete folder with files in phpdeleting a folder in phpdelete a file from a directory phpphp remove dir with filesdelete folder with phpphp dir delete filesdelete folder with its file and subfolders in phpphp remove files in folderphp delete folder and all fileshow to delete a directory phpphp remove folder with filesphp delete folder on folderphp delete folder with filesdelete file php from directory phpphp function removes an directory completelypath remove directory using phpremove directory from linux phpdelete dir phpphp delete file in folderhow to remove directory using phpphp code to delete all foldersremove a directory in phpremove directory with files in phpphp delete complete directorydelete folder and contents using phprmdir phpdelete file from folder in phpremovedirectory phpremove file and folder from directory in phpphp remove folderphp delete folderdelte direcortry and files phpdelete a directory phphow to delete one dir using phpdelete folders in phphow to delete a file from a directory using phpdelete file php from directoryhow to delete file or folder using phphow to delete a file in php from folderremove folder phpphp delete directory coderemove dir in phpremove folder with phpphp rm folderdirectory delete phpremove directory and its subfolders phpphp delete folder contentsdremove directory with phphow to delete a folder phpdelete directory php codingatorhow to delete dir phpdelete dir in phphow to delete a folder in phpdelete a folder using php exechow to delete a folder with files in phpphp remove folder with contentdelete file mkdir phpphp delete a file from a directorydelete folder using phpphp deletel folderphp delete directory with filesphp remove dirfunction delete directory phphow to delete inner directory in phpdelete file in directory phpremove a dir in phpremove the folder with files in phpphp delete directory and create directoryphp delete folder and filesdelete directory folder phpdelete full directory php 5cdelete content of a folder phpphp clear directoryphp delete folder and contentsdelete a folder function in phpdelete folder in phpdelete directory phpremove a folder phpdelete folder with phphremove dir phpremove dir with phpdelete files in php from folderphp remove directoryhow to delete dir through function in phpphp remove directory with fileshow to remove directory in phpget delete folder in phpphp delete directorudelete files from folder phpdelete directory with phpdelete file from folder phpphp delete file from another directory phphow to delete folder in phprmdir not working phremove files in a directory phphow to delete a directory in phpdelete a folder with code phpphp remove file and folderways to delete folder in phpphp delete files in folderphp delete files from folderphp mkdir and remove dirget delete folder in php