I got an array containing path names and file names
['css/demo/main.css', 'home.css', 'admin/main.css','account']
I want to create those files and folders if they are not existed yet. Overwrite them if they are already existed.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For each of this paths you’ll have to specific whether it is a file or a directory. Or you could make your script assume, that the path is pointing to a file when the basename (the last part of the path) contains a dot.
To create a directory recursively is simple:
0755is the file permission expression, you can read about it here: http://ch.php.net/manual/en/function.chmod.php