After execution, the file can be created successfully, but an error message is always givenWarning: mkdir(): File exists in D:wamp64wwwaaa.php on line 26
I only go back to execute this sentence when $name2 obviously does not exist
if(!is_dir($name2)){ mkdir(iconv("UTF-8", "GBK", $name2),0777,true); }
After execution, the file can be created successfully, but an error message is always givenWarning: mkdir(): File exists in D:wamp64wwwaaa.php on line 26
I only go back to execute this sentence when $name2 obviously does not exist
if(!is_dir($name2)){ mkdir(iconv("UTF-8", "GBK", $name2),0777,true); }
I just tested it and there is nothing wrong with your code. Please check it or take a look at the logic.