Salve, stavo provando questo codice per ottenere nome, tipo di file, dimensione del file e link di tutti i file in una cartella, però ho un problema: filesize e filetype non funzionano, o meglio non appaiono. Ho provato anche ad usare stat ma niente..


Codice PHP:
<style type="text/css">
th, td {
width: 25%;
}

th {
background: #FFE4C4;
}

table {
width: 60%;
margin: auto;
}
</style>
<table border="1">
   <thead>
          <tr>
                 <th>Nome File</th>
                 <th>Tipo di File</th>
                 <th>Dimensione File</th>
                 <th>Link File</th>
          </tr>
   </thead>
   <tbody>
<?php

$cartella 
opendir('./images');
while (
$file readdir($cartella)) {
$file_array[] = $file;
sort($file_array);
}
foreach (
$file_array as $file) {
if ( 
$file == ".." || $file == ".") {
continue;
}
echo 
'<tr>
          <td>'
.$file.'</td>
          <td>'
.filetype($file).'</td>
          <td>'
.filesize($file).'</td>
          <td>[url="images/'
.$file.'"]Clicca qui[/url]</td>
          </tr>'
;
}
?> 
   </tbody>
</table>
Codice PHP:
<style type="text/css">
th, td {
width: 25%;
}

th {
background: #FFE4C4;
}

table {
width: 60%;
margin: auto;
}
</style>
<table border="1">
   <thead>
          <tr>
                 <th>Nome File</th>
                 <th>Tipo di File</th>
                 <th>Dimensione File</th>
                 <th>Link File</th>
          </tr>
   </thead>
   <tbody>
<?php

$cartella 
opendir('./images');
while (
$file readdir($cartella)) {
$file_array[] = $file;
sort($file_array);
}
foreach (
$file_array as $file) {
if ( 
$file == ".." || $file == ".") {
continue;
}
$stat stat($file);
echo 
'<tr>
          <td>'
.$file.'</td>
          <td>'
.$stat['rdev'].'</td>
          <td>'
.$stat['size'].'</td>
          <td>[url="images/'
.$file.'"]Clicca qui[/url]</td>
          </tr>'
;
}
?> 
   </tbody>
</table>
Da cosa dipende il problema? Il bello è che nel secondo nemmeno da errore per gli apici..