*/
function makedirectory($directoryname) {
$directoryname = str_replace("","/",$directoryname);
$dirnames = explode('/', $directoryname);
$total = count($dirnames) ;
$temp = '';
for($i=0; $i<$total; $i++) {
$temp .= $dirnames[$i].'/';
if (!is_dir($temp)) {
$oldmask = umask(0);
if (!mkdir($temp, 0777)) exit("不能建立目錄 $temp");
umask($oldmask);
}
}
return true;
}