I am populating a datatables table with images on a FTP server. I'm declaring my TRs and TDs and a TR has 5 TDs. I have PHP code to formulate these TRs and TDs. Datatables is working perfectly with this, but I have 80,000 images and it takes forever to load and crashes. When I limit the images to around 4000, it loads just fine. I can't use the server side processing method since the images aren't coming from a sql table. I'm getting the images like this:
function getAllImgs($directory){
$resizedFilePath = array();
foreach ($directory AS $dir) {
foreach (glob($dir . '*.jpg') as $filename) {
array_push($resizedFilePath, $filename);
}
}
return $resizedFilePath;
}
I'm then using a foreach loop to add the filepaths to TDs. How can I load the whole 80,000 images without crashing the page?