echo "<table><tbody>"; $total_filesize = 0; if(!empty($_GET['my_scandir'])){ function my_scandir($dir){ global $total_filesize; $files = scandir($dir); foreach($files as $file){ if($file != "." AND $file != ".."){ if(is_dir($dir."/".$file)){ my_scandir($dir."/".$file); }else{ $filesize = filesize($dir."/".$file) / 1024 ; $total_filesize += $filesize; $style = ""; if($filesize > 1024*10){ $style .= "background:#3498db;color:#fff"; } if(true/*$filesize > 1024*/){ echo "<tr>"; echo "<td>"; echo $dir."/".$file; echo "</td>"; echo "<td style='".$style."'>"; echo round($filesize, 2)." KB;"; echo "</td>"; echo "</tr>"; } } } } } my_scandir($_SERVER['DOCUMENT_ROOT']); echo $total_filesize." KB;"; } echo "</tbody></table>";
Комментарии (0)
Не писать ответ