I have a PHP array with about 10,000 keys organized like this:
Array
(
[0] => Array
(
[id] => 13154
[photo_file] => 013154.jpg
)
[1] => Array
(
[id] => 7885
[photo_file] => 007885.jpg
)
)
And in the HTML file I have a loop that transforms the array into image tags like this:
<?php
foreach ($array as $key => $value) {
$photo_file = $array[$key]["photo_file"];
echo "<img src='$photo_file' />";
?>
I wanted to create an Infinite Scroll from this PHP array to avoid loading all the images at once when the page was accessed. Any ideas on the best way to do this?
Maybe I could convert the PHP array to JSON and then to a Javascript variable to use JQuery?