No products in the cart.
Forum Replies Created
Viewing 1 post (of 1 total)
- AuthorPosts
-
aditya-malviya
ParticipantWe should always modularise our code and I’ve written the same check it below…
We first check the directory. If the directory is absent, we create the directory.
$boolDirPresents = $this->CheckDir($DirectoryName); if (!$boolDirPresents) { $boolCreateDirectory = $this->CreateDirectory($DirectoryName); if ($boolCreateDirectory) { echo "Created successfully"; } } function CheckDir($DirName) { if (file_exists($DirName)) { echo "Dir Exists<br>"; return true; } else { echo "Dir Not Absent<br>"; return false; } } function CreateDirectory($DirName) { if (mkdir($DirName, 0777)) { return true; } else { return false; } }
- AuthorPosts
Viewing 1 post (of 1 total)