Created
July 12, 2019 01:04
-
-
Save cp6/94ff56da789b2d1072b4d05974547be7 to your computer and use it in GitHub Desktop.
Create directory based on Year, Month and Day PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function create_date_dir($start_dir = ''){ | |
$year = date("Y"); | |
$month = date("m"); | |
$day = date("d"); | |
$directory = "".$start_dir."$year/$month/$day/"; | |
if(!is_dir($directory)){ | |
mkdir($directory, 755, true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment