Copy the code The code is as follows:
/*
Traverse folders; Function: (a) Deleteable files (b) Editable text, web page files (c) Deleteable folders, provided the folder is empty (d) Yes Create files, folders, and modify folder names;
lost63.com original, please indicate the source for reprinting. Communication QQ: 35501547
*/
$path=$DOCUMENT_ROOT;
$path=str_replace("/","\" ,$path);
//Specify the folder
$path=$path."\";
if($_GET['folder'])
{
$path.=$_GET['folder']."\ ";
}
//The path of this page will be used when returning below;
$url=$_SERVER['PHP_SELF'];
//If it is a folder, a link will be added;
function folder($path ,$str)
{
if(filetype($path.$str)=="dir")
{
return "$str";
}else{
return $str;
}
}
switch($_GET['action'])
{
case "del";
if ($_GET['type']=="file")
{
unlink($_GET['path']);
}else{
rmdir($_GET['path']);
}
echo "< ;script type="text/javascript">alert('Congratulations, deletion successful!');location.href="".$url."";";
break;
case "edit" ;
if($_GET['type']=="file")
{
$file=fopen($_GET['path'],"r");
while(!feof($file))
{
$result.=fgets($file,9999);
}
fclose($file);
echo '
>> 文件管理 > 建立文件 > 返回 | |||
文件/文件夹 | 文件属性 | 文件大小 | 操作 |
'.folder($path,$value).' | '.filetype($path.$value).' | '.round(filesize($path.$value)/1024).'kb | 编辑 | '.$value.'');">删除 |
以上就介绍了psp3000游戏放在哪个文件夹 php实现的遍历文件夹下所有文件,编辑删除,包括了psp3000游戏放在哪个文件夹方面的内容,希望对PHP教程有兴趣的朋友有所帮助。