Use this code snippet to check if folder exists using PHP.
$directory = "/path/to/folder/";
if ( !file_exists( $directory ) ) {
// create the directory
mkdir($directory, 0755, true);
// do something with the directory
} else {
// directory exists so do something with the it
}
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.