List Info

Thread: note 78086 added to function.rmdir




note 78086 added to function.rmdir
user name
2007-09-27 00:58:09
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/78086
Del: integrated  -- h
ttps://master.php.net/note/delete/78086/integrated
Del: useless     -- http
s://master.php.net/note/delete/78086/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/78086/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/78086/spam
Del: non-english -- 
https://master.php.net/note/delete/78086/non-english
Del: in docs     -- http
s://master.php.net/note/delete/78086/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78086
Reject      -- https://mast
er.php.net/note/reject/78086
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 78086 deleted from function.rmdir by bjori
user name
2007-09-27 07:26:58
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 )