[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • Last Modified:

how can i write the php to create folder

How can i write progrm in php to check to show all file indirectory ?  
0
teera
Asked:
teera
1 Solution
 
sajuksCommented:
//simple example
do u want to create folder or show all files in directory , ur title and context are different ?
to create direc http://www.php.net/manual/en/function.mkdir.php
<?php
mkdir("/path/to/my/dir", 0700);
?>

<?php
$this_path = getcwd();
if ($handle = opendir($this_path)) {
    echo "Files:<br>\n";
    while (false !== ($file = readdir($handle))) {
      if ($file != "." && $file != ".." && $file != "index.php") {
        echo "$file<br>\n";
       }
    }
    closedir($handle);
}
?>
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now