php recursively delete directory

Solutions on MaxInterview for php recursively delete directory by the best coders in the world

showing results for - "php recursively delete directory"
Eva
13 Jan 2019
1function removeDirectory($path) {
2
3	$files = glob($path . '/*');
4	foreach ($files as $file) {
5		is_dir($file) ? removeDirectory($file) : unlink($file);
6	}
7	rmdir($path);
8
9	return;
10}