3
Hello, I would like to know how to create multiple folders at once, for example with that code:
<?php
$empresa = "Google";
$tipo = "Abertura";
$nome = "Contrato Social";
mkdir('$empresa/$tipo/$nome');
?>
Now with this data I would like to create in this case 3 folders that would be the Google -> Opening -> Social Contract, in case google is the parent folder and opening is inside it, and social contract is another folder that is inside opening, which is inside google, got a little confused but would be something like this:
Google Companies Opening Social contract
EDIT:
I put together something more or less like this but still it makes a mistake, it doesn’t create the folders inside, it creates outside like Joaquim Sauro.FGTS
<?php
$nome_user = "Joaquim Sauro";
$tipo = "FGTS";
$categoria = "Abertura";
$pdf = "pdf.pdf";
$pathName = "html/empresas/" . $nome_user;
mkdir($pathName,0777,true);
echo "OK1";
$pathName2 = "html/empresas/.$nome_user."/"" . $tipo;
mkdir($pathName2,0777,true);
echo "OK1.1";
$pathName3 = "html/empresas/.$nome_user."/".$tipo."/"" . $categoria;
mkdir($pathName3,0777,true);
echo "OK1.2";
move_uploaded_file($pdf,$pathName3);
?>