<?php
  $dir = "./";

  $arr = scandir($dir);
  $dirs = array();
  $files = array();

  foreach($arr as $val){
    if(is_dir($dir.$val)){
      $dirs[] = $val;
    }
    else if(is_file($dir.$val)){
      $files[] = $val;
    }
  }

  echo "<strong>Katalogi</strong><br>";
  foreach($dirs as $val){
    echo "$val<br>";
  }

  echo "<br><strong>Pliki</strong><br>";
  foreach($files as $val){
    echo "$val<br>";
  }
?>
