1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
<?PHP
header('Content-type: text/html; charset=65001');
?>
<!DOCTYPE html>
<html lang='fr'>
<head>
<meta charset="65001">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<![endif]-->
<title>Model type jplyne </title>
<meta name="keywords" content="Model type jplyne" />
<meta name="description" content="Model type jplyne" />
</head>
<body>
<?php
function liste_dos($nom)
{
echo "<br /><b>==".$nom."==</b><br />";
if ($dir = opendir($nom))
{
while ($file = readdir($dir))
{
if (!($file == '.' || $file == '..'))
{
$garde=0; // ==== on pas
$LeType = array('.mpg','.avi','.flv','.wmv','.nrg','.mp4','.vob','.mkv','.ts','.m2ts','.iso','');
for($at=0;$at<11;$at++)
{
$flag=strpos($file, $LeType[$at]) ;
if ($flag >0 ) $garde=99;
}
if ($garde==99)
{
$work=$file;
$work=str_replace(" ","-",$work);
$work=str_replace("_","-",$work);
$work=str_replace("'","-",$work);
$work=str_replace("`","-",$work);
$work=str_replace("--","-",$work);
$work=str_replace("--","-",$work);
$work=str_replace("--","-",$work);
$old=$nom."\\".$file;
$new=$nom."\\".$work;
rename($old,$new);
echo "".$file."--".$work." <br> ";
}
$path = $nom.DIRECTORY_SEPARATOR;
if (is_dir($path.$file) && !in_array($file, array(".", "..")))
{
liste_dos($path.$file);
}
}
}
closedir($dir);
}
}
liste_dos('.');
?>
</body></html> |
Partager