您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

帮忙看看看这个代码有什么有关问题

2024/2/26 17:53:47发布18次查看
大虾帮忙看看看这个代码有什么问题?
运行这个模块时,下面红字部分报错warning: mkdir() [function.mkdir]: no such file or directory
/**
* 函数名称: createdir
* 函数功能: 创建文件夹
* 输入参数:
$root ---------------- 根路径
$type ---------------- 类型
* 函数返回值: 返回值说明
* 其它说明: 说明
*/
function createdir($root,$type)
{
if(!file_exists($root./.$type))
{
$dir_arr = $root./.$type;
if(mkdir($dir_arr)&&chmod($dir_arr,0777))
{
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}
------解决方案--------------------
php codeif(!file_exists($root./.$type)) //这里将!去掉{$dir_arr = $root./.$type;
------解决方案--------------------
bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )
带上mode,带上true,递归创建。 另外@抑制错误,检查mkdir返回值。

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product