In this tutorial learn how to create directory using php if directory not created without using command.
/* * Create Directory if not available */ function createDirectory(string $directory): bool { return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory)); } echo createDirectory("demo");
Using the mkdir() method can create a new function and check directory using is_check().
No comments:
Post a Comment