PHP Help with hd 50000 images

0

How to do in php load 50000 images of a hd

My code

<?php
$imgdir = '/media/hd-ext/Images/JPG/'; //Minha Pasta
$allowed_types = array('jpeg'); //Tipo de extensao
$dimg = opendir($imgdir);//Abre o Diretorio
while($imgfile = readdir($dimg))
{
  if( in_array(strtolower(substr($imgfile,-3)),$allowed_types) OR
      in_array(strtolower(substr($imgfile,-4)),$allowed_types) )
/*Se o arquivo for uma imagem, adicione-o array*/
  {$a_img[] = $imgfile;}
}
echo "<ul>";

 $totimg = count($a_img);  //Conta o taotal de imagens
//Echo nas imagens dentro do li.
 for($x=0; $x < $totimg; $x++){echo "<li><img src='" . $imgdir . $a_img[$x] . "' /></li>";}
echo "</ul>";
?>

separating by date equal to google photos

Error! loads the images but it takes 3 days to load all the images!

    
asked by anonymous 09.11.2017 / 15:34

1 answer

1

50000 images is an absurd amount of data for a browser load, make a management to be loaded a certain amount at a time, otherwise loading all this in 3 days will be the minimum time spent rs

    
16.07.2018 / 17:25