Question: I want to create a directory if it does not exist already.

Is using the `is_dir` function enough for that purpose?

```
if ( !is_dir( $dir ) ) {
    mkdir( $dir );       
}

```

Or should I combine `is_dir` with `file_exists`?

```
if ( !file_exists( $dir ) && !is_dir( $dir ) ) {
    mkdir( $dir );       
} 

```

Answer: 
```
$save_folder = "some/path/" . date('dmy');

if (!file_exists($save_folder)) {
   mkdir($save_folder, 0777);
}

```
This is how I do

```
if(is_dir("./folder/test"))
{
  echo "Exist";
}else{
  echo "Not exist";
}

```