כן.
תקבל מספר עמוד בGET, נקרא לו page
תקבע את מספר התמונות לעמוד, נקרא לו imgp
תיצור לולאת for שמתחילה בpage*imgp - imgp ומסתיימת בpage*imgp
כל פעם תיקח מהמערך לפי הkey הנוכחי.
צריך לצאת משהו כזה:
PHP קוד:
$files = array("ele1","ele2",...,"elen"); // Array of the files
$imgp = 10; // Value of images per page
$_GET['page'] = isset($_GET['page'])?$_GET['page']:1; // Checks if a page setted, else set it to 1
for($i=$_GET['page']*$imgp-$imgp;$i<$_GET['page']*$imgp;$i++) {
echo $file[$i];
}