Let us tell you how to create dynamic folder in PHP named “Current year” (आइये हम आपको बताते हैं कि PHP में “Current year” नाम से डायनामिक फोल्डर कैसे बनाया जाता है).
For Example today date is “12-10-2020” (उदाहरण के लिए आज की तारीख “12-10-2020” है) –
<?php
$current_date = date('d-m-Y'); // get current date
$floder_name = date('Y'); // current year
$path = "upload/"; // root path
if (!is_dir($path . $floder_name)) { // checked if folder name is not exits
mkdir($path . $floder_name, 0777, TRUE);
chmod($path . $floder_name, 0777);
}
?>- Output –

Top 20 HTML Interview Questions and Answers…
How to create dynamic folder in php

