0
How to load 50,000 images from a hard drive in php
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 images but takes 3 days to load all images!
It’s too much for a browser to load and show, you would need to page this list.
– bfavaretto