以下为引用的内容:
//wangsu820@
//-08-28
$folder = "D:\p8-server\wwwroot\\"."test\image";
if( !file_exists( $folder ) )
{
if( !mkdir( $folder,777 ) )
{
echo "mkdir $folder (mode:777) error
";
}
else
{
echo "mkdir $folder (mode:777) okay
";
}
}
$filename = "aaa.jpg";
$filepath = $folder . "\\" . $filename;
if( !file_exists( $filepath ) )
{
die( "$filepath not exist
" );
}
else
{
echo "
";
echo "
deleting $filepath ......
";
if( !unlink( $filepath ) )
{
echo "unlink $filepath error
";
}
else
{
echo "unlink $filepath okay
";
if( !rmdir( $folder ) )
{
echo "rmdir $folder error
";
}
else
{
echo "rmdir $folder okay
";
}
}
}
?>
如果觉得《php图片上传在哪个文件夹 php删除上传的图片及文件夹》对你有帮助,请点赞、收藏,并留下你的观点哦!