4
I wonder how I can apply with a single code in php chmod 777 in a folder and subfolders at once in case I have a folder called images and inside it has 4 subfolders need to perform chmod 777 in them with a single code instead of using the code below.
And there is some way gave apply in the case chmod 777 in the images folder and in all its subfolders with a single code ?
<?php
$chmod = chmod("imagens", 0777);
$chmod = chmod("imagens/medias", 0777);
$chmod = chmod("imagens/capas", 0777);
$chmod = chmod("imagens/icones", 0777);
$chmod = chmod("imagens/screen_shots", 0777);
?>
Thanks for your help.
– Striffer
If the answer helped you, don’t forget to validate it =)
– Caio Felipe Pereira
@Caiofelipepereira failed to explain the function of
RecursiveDirectoryIterator
.– gmsantos
@gmsantos http://php.net/manual/en/class.recursivedirectoryiterator.php
– fbiazi
@gmsantos guess that wasn’t quite the scope of the question, why I just inked the documentation
– Caio Felipe Pereira
@caio suggested this to make the answer richer :) besides solving the doubt I like to explain the pq I used method x.
– gmsantos