if (!file_exists($dir)){ mkdir ($dir,0777,true); echo '创建文件夹bookcover成功'; } else { echo '需创建的文件夹bookcover已经存在'; }