Originariamente inviato da KajinDetier
Codice PHP:
$dir = "directory/";
$input = 0;
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
$ext = array_reverse ( explode ( '.', $file ) );
if($ext[0] == "jpg")
{
$input++;
}
}
closedir($dh);
}
}
print $input; //Numero file JPG
Questa è l'unica soluzione che mi viene in mente
grazie!
nel mio caso devo fare così:
Codice PHP:
$dir = "directory/";
$input = 0;
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false)
if (subs($file, 0, 2) == "ev")
$input++;
closedir($dh);
}
}
print $input; //Numero file JPG