-
replace folder
Hello,
i am using the following line of code to create new directories for every course in a .xml file
Code:
mkdir("C:\arxeio\-Lesson id-$cid", 0700);
once the directory is beeing created how can i replace it in order not to get the following warning
Code:
Warning: mkdir() [function.mkdir]: File exists in C:\xampp\htdocs\thalis\arxeiothetisis.php on line 33
I am working with PHP5
Thanks
-
Re: replace folder
Moved since Forum Feedback is only meant for questions and comments about VB Forums itself.
-
Re: replace folder
if the directory already exists, why do you want to replace it? just check to see if it exists, and if it does, skip it.
-
Re: replace folder
How can i skip it?:confused:
-
Re: replace folder
in your loop you just need to check if it exists before you create it, then just don't call mkdir() if it's already there.. you can use is_dir() to check whether or not a directory already exists. it will return false if it doesn't exist or if it isn't a directory. it will return true if it does exist and is a directory.