Create a folder if it doesn’t already exist PHP

Create a folder if it doesn’t already exist PHP

July 19, 2020

To create a folder if it doesn’t already exist in PHP use below code

<?php
if (!file_exists('path/to/directory')) {
    mkdir('path/to/directory', 0777, true);
}
?>

Avada Programmer

Hello! We are a group of skilled developers and programmers.

Hello! We are a group of skilled developers and programmers.

We have experience in working with different platforms, systems, and devices to create products that are compatible and accessible.