how can i write the php to create folder

Posted on 2005-05-07
Last Modified: 2006-11-18
How can i write progrm in php to check to show all file indirectory ?  
Question by:teera
    1 Comment
    LVL 33

    Accepted Solution

    //simple example
    do u want to create folder or show all files in directory , ur title and context are different ?
    to create direc
    mkdir("/path/to/my/dir", 0700);

    $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";

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now