opendir

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function deletefolder($path) { 
    if ($handle = opendir($path)) {
      while (false !== ($file = readdir($handle))) { 
       if ($file<>"." AND $file<>"..") {
        if ($file != "." &amp;&amp; $file != "..") { 
          echo "$file\n"; 
        } 
         if (is_dir($path.'/'.$file)) { 
          deletefolder($path.'/'.$file); 
         }
        }
      }
 
    }  
} 
deletefolder("1");

closedir

1
2
3
4
5
6
7
8
9
10
$a =(". / AppA");
if($f = opendir($a)) {
echo ;
if (closedir($f)==false) {
echo ;
 }
}
 else {
   echo "Do not open!";
 }

readdir

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function deletefolder($path) { 
    if ($handle = opendir($path)) {
      while (false !== ($file = readdir($handle))) { 
       if ($file<>"." AND $file<>"..") {
        if ($file != "." &amp;&amp; $file != "..") { 
          echo "$file\n"; 
        } 
         if (is_dir($path.'/'.$file)) { 
          deletefolder($path.'/'.$file); 
         }
        }
      }
 
    }  
} 
deletefolder("1");

rmdir

1
2
$a =("./AppA");
rmdir($a);

mkdir

1
2
$a =("./AppA");
mkdir($a);

file_exists

1
2
3
4
5
6
7
$ Default_dir = "X: \ home \ p2 \ www \ Ch03"; 
if (file_exists($ Default_dir)) { 
  rmdir($ Default_dir); 
 }
 else {
 mkdir($ Default_dir); 
 }

dirname

1
2
3
4
5
$ Default_dir = "X: \ home \ p2 \ www \ Ch03"; 
if (file_exists($ Default_dir)) {
$a=dirname($ Default_dir);
   echo $a; 
}

is_dir

1
2
3
$a =("./Ch16");
if(!($c= is_dir($a))) die ("This is not a directory!");
echo $c;

Nice Ajax Poll

Which one of my extensions is the best?

Statistics

Advertisement