PHP Create directory

Creates a directory in the server’s file system.

function makeDirectory($path) {
  if (!is_dir($path)) {
    $oldumask = umask(0);
    mkdir($path, 0777);
    umask($oldumask);
    chmod($path, 0777); // octal; correct value of mode
  }
}

Found this useful? Donations appreciated to help keep this blog alive.

Related Posts Plugin for WordPress, Blogger...
  1. 3 Responses to “PHP Create directory”

  2. Cool !!!!!!

    By Max on Dec 25, 2008

  3. Will this script work on a Windows server?

    By Victor on Jan 20, 2009

  4. hi vic, it should. it is the php plugin that is installed in the windows server that will interpret the code. not the windows server

    By tech on Jan 20, 2009

Post a Comment