Commit 82881085 authored by Nico Schallehn's avatar Nico Schallehn

test

parent 8d78f0b0
<?php
$dir ="/media/QNAP/";
/*
$kommando = 'find '.$dir.' * | grep mkv';
echo $kommando.PHP_EOL;
$String = exec('find '.$dir.' * | grep mkv');
//var_dump(scandir($String));
echo $String;
\ No newline at end of file
echo $String;*/
function dirtoArray($dir, $root = ''){
$Arr = scandir($dir);
$FolderIgnor = array('.@__thumb', '@Recycle', 'HD-Serien', 'Die Olsenbande', 'Serien');
unset($Arr[array_search('.', $Arr)]);
unset($Arr[array_search('..', $Arr)]);
unset($Arr[array_search('.@__thumb', $Arr)]);
foreach ( $Arr AS $Key => $Value){
if(is_dir ($dir.'/'.$Value) AND !in_array($Value, $FolderIgnor)){
$SubDir = dirtoArray($dir.'/'.$Value, $root.'/'.$Value);
//print_r($SubDir);
//$OutArray[] = $dir.'/'.$Value;
//$OutArray = array_merge($OutArray, $SubDir);
}
else{
$Notindexed[] = $root.'/'.$Value;
//echo $root.'/'.$Value.'<br>';
}
}
return $Notindexed;
}
echo var_dump(dirtoArray($dir));
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment