Using php 7 on mac os x, I can't create a folder with php mkdir()
if the folder name has a slash in it, e.g. Test 24/04/2015
.
Here's my PHP code:
$FolderPath = readline("Insert Folder Path "); // I enter /Users/me/Test 24/04/2015
echo "You have entered: " . $FolderPath;
echo "\n";
echo "\n";
$FolderPathResized = $FolderPath . "/Resized";
if (file_exists($FolderPathResized)) {
echo "The folder $FolderPathResized exists";
echo "\n";
}else {
mkdir($FolderPathResized);
}
The error I get is:
mkdir(): No such file or directory in
How can I use mkdir()
in such case? My folders will always have dates separates with slashes in the folder name.