if dir not exist create php code example
Example: linux php script create directory if doesn't exist
$path = "sample/path/newfolder";
if (!file_exists($path)) {
mkdir($path, 0777, true);
}
$path = "sample/path/newfolder";
if (!file_exists($path)) {
mkdir($path, 0777, true);
}