[PHP] Create a folder if it doesn’t already exist

some time you may have to use PHP to dynamically create folders

you can use code this for crate folders

Syntax

if (!file_exists('path/directory')) {
  mkdir('path/directory', 0777, true);
}

Example for Windows

if (!file_exists('C:/Temp/Directory')) {
  mkdir('C:/Temp/Directory', 0777, true);
}