Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,885 questions

51,811 answers

573 users

How to create folder (directory) on server disk in PHP

3 Answers

0 votes
/*
bool mkdir ( string $pathname [, int $mode = 0777 
                              [, bool $recursive = false 
                              [, resource $context ]]] )
*/

if (!file_exists("ttt"))
    mkdir("ttt", 0777, true); // ttt is folder name


answered Apr 23, 2014 by avibootz
edited Dec 17, 2015 by avibootz
0 votes
/*
bool mkdir ( string $pathname [, int $mode = 0777 
                              [, bool $recursive = false 
                              [, resource $context ]]] )
*/

$folder = "tmp";
if ( ! file_exists($folder)) 
{
    mkdir($folder, 0777, true);
    echo $folder . " Folder Created Successful";
}
else
    echo $folder . " Exist";


answered Jul 8, 2014 by avibootz
edited Dec 17, 2015 by avibootz
0 votes
/*
bool mkdir ( string $pathname [, int $mode = 0777 
                              [, bool $recursive = false 
                              [, resource $context ]]] )
*/

mkdir("e:/tmp");


/*
run:

check for the directory you have created

*/

 



answered Dec 17, 2015 by avibootz
edited Dec 17, 2015 by avibootz

Related questions

2 answers 218 views
218 views asked Sep 28, 2015 by avibootz
1 answer 237 views
1 answer 188 views
188 views asked Aug 2, 2018 by avibootz
1 answer 180 views
180 views asked Aug 25, 2015 by avibootz
1 answer 144 views
1 answer 153 views
153 views asked Jul 2, 2020 by avibootz
...