Now in my code one folder is createed like private/119
when I logged into my application. The code is,
if (!is_dir('private/'.$q->row()->userId)) {
$oldmask = umask(0);
$q=mkdir('private/' .$q->row()->userId,0777,true);
umask($oldmask);
copy('public/images/default_user.png','private/'.$q->row()->userId.'/default-profile_pic.png');
}
Now I want to create a one more folder inside that userId(119) folder. How to do that? I have tried something like that $q=mkdir('private/' .$q->row()->userId .'/beforeconvert',0777,true);
but it is not working.
Or is the following code is correct?
if (!is_dir('private/'.$q->row()->userId) && !is_dir('private/'.$q->row()->userId .'/beforeconvert')) {
$oldmask = umask(0);
$q=mkdir('private/' .$q->row()->userId,0777,true);
$create_folder = mkdir('private/' .$q->row()->userId .'/beforeconvert',0777,TRUE);
umask($oldmask);
copy('public/images/default_user.png','private/'.$q->row()->userId.'/default-profile_pic.png');
}