Learn how to a build a cloud-first strategyRegister Now

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

PHP If Directory does not exists ... do something

Hi all,

How do I do this please...

IF somedirectory does not exists {
  //do something
}

No else needed. I just want it to create the directory only IF its not already there.

Thanks
0
error77
Asked:
error77
1 Solution
 
DerokorianCommented:
if( !is_dir('/path/to/check') )
   mkdir('/path/to/check');

Open in new window

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