I need a way in PHP to create some folder if they do not exist.
So the code will have to first read the available folders, if the specific folder does not exist then it should create it.
The logic of the code would be:
$folderName = "user1";
If($folderName exists) {
exit;
}else{
create folder $folderName and chmod 777
}
How would I do it with PHP and Linux server + Apache?
In
ifstatement we check if folder does not exist (yes – withfile_existsfunction) and if not, we create folder.777chmod is by default.