To know how many POSTs have been done, it would be:
$numero_archivos = count($_POST);
echo $numero_archivos;
To know how many POSTs in the same location:
$archivos = $_POST['file'];
$num_archivos = count($archivos);
echo $num_archivos;
The latter is because in a position to be able to save more than one
value in a POST space the variable $ files is declared as a
array.
Account only files that are images (only png and jpg):
<?php
$contador=0;
$ficheros = $_POST['file'];
foreach($ficheros as $fichero){
$pos_punto = strpos($fichero, ".");
$formato = substr($fichero, $pos_punto+1);
if($formato=="png"||$formato=="jpg"){
contador++;
}
}
echo "Hay ".$contador." archivos de imagenes.";
?>