function createFolder($path) { if (!file_exists($path)) { createFolder(dirname($path)); mkdir($path, 0777); } } createFolder("2007/3/4");//在当前目录下创建2007/3/4的目录结构.