php mkdir with 777 permission code example Example: php mkdir with 777 permission $oldmask = umask(0); mkdir("test", 0777); umask($oldmask);