Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to create new folder using php

by
Category:php
php
How to create new folder using php

In this tutorial we will create new folder using php. i have used the mkdir command to make a folder, however i would like it to make a folder based on the username of the person who is currently logged in. You may also like How to check a folder doesn't already exist using php and How to Copy file from one folder to another folder using PHP.

PHP Code

$candidate_id = 1;
if (! is_dir ( './public/images/candidate/'.$candidate_id )) {
    mkdir ( './public/images/candidate/'.$candidate_id, 0777, true );
}
if (! is_dir ( './public/images/candidate/'.$candidate_id.'/candidate_photo' )) {
        mkdir ( './public/images/candidate/'.$candidate_id.'/candidate_photo', 0777, true );
}

0 Comments


Html code work in comment box


Related Post