List Info

Thread: note 78463 added to function.rmdir




note 78463 added to function.rmdir
user name
2007-10-12 20:38:24
For those still using PHP 4, here is an alternative to the
last post:

<?php

function deltree($path) {
  if (is_dir($path)) {
    if ($handle = opendir($path)) {
      while (false !== ($file = readdir($handle))) {
        if ($file != '.' && $file != '..') {
          unlink($path."/".$file);
          }
        }
      closedir($handle);
      rmdir($path);
      return 1;
      }
    }
  return;
  }

?>
----
Server IP: 209.41.74.194
Probable Submitter: 76.81.192.50
----
Manual Page -- http:
//www.php.net/manual/en/function.rmdir.php
Edit        -- https://master
.php.net/note/edit/78463
Del: integrated  -- h
ttps://master.php.net/note/delete/78463/integrated
Del: useless     -- http
s://master.php.net/note/delete/78463/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/78463/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/78463/spam
Del: non-english -- 
https://master.php.net/note/delete/78463/non-english
Del: in docs     -- http
s://master.php.net/note/delete/78463/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78463
Reject      -- https://mast
er.php.net/note/reject/78463
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


[1]

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