List Info

Thread: note 78087 added to function.rmdir




note 78087 added to function.rmdir
user name
2007-09-27 00:58:10
function deldir($dir){
	if(is_dir($dir)){
		$rdir = $dir;
		if($dirlist = scandir($rdir)){
				array_shift($dirlist);
				array_shift($dirlist);
			foreach($dirlist as $d){
				$rd = $rdir.'/'.$d;
				if(isset($d) && is_file($rd)){
					unlink($rd);
				}else{
					deldir($rd);
				}
			}
			rmdir($rdir);
		}else{
			return false;
		}
	}
	return true;
}
----
Server IP: 69.147.83.197
Probable Submitter: 219.235.14.243
----
Manual Page -- http:
//www.php.net/manual/en/function.rmdir.php
Edit        -- https://master
.php.net/note/edit/78087
Del: integrated  -- h
ttps://master.php.net/note/delete/78087/integrated
Del: useless     -- http
s://master.php.net/note/delete/78087/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/78087/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/78087/spam
Del: non-english -- 
https://master.php.net/note/delete/78087/non-english
Del: in docs     -- http
s://master.php.net/note/delete/78087/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78087
Reject      -- https://mast
er.php.net/note/reject/78087
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


note 78087 deleted from function.rmdir by bjori
user name
2007-09-27 07:26:52
Note Submitter: millken
Reason: bad code

----

function deldir($dir){
	if(is_dir($dir)){
		$rdir = $dir;
		if($dirlist = scandir($rdir)){
				array_shift($dirlist);
				array_shift($dirlist);
			foreach($dirlist as $d){
				$rd = $rdir.'/'.$d;
				if(isset($d) && is_file($rd)){
					unlink($rd);
				}else{
					deldir($rd);
				}
			}
			rmdir($rdir);
		}else{
			return false;
		}
	}
	return true;
}

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )