foreach(array_slice(glob('/res/images/*.jpg'), 0, 999) as $filename)
is work fine but
foreach(array_slice(glob('/res/images/*.jpg'), 0, 1000) as $filename)
doesnt work. Where is I can change such limit?
foreach(array_slice(glob('/res/images/*.jpg'), 0, 999) as $filename)
is work fine but
foreach(array_slice(glob('/res/images/*.jpg'), 0, 1000) as $filename)
doesnt work. Where is I can change such limit?
Try with simple(May be the better) manner like
$i = 0;
foreach(glob('/res/images/*.jpg') as $filename) {
if($i++ <= 1000) {
// Do the display
} else {
break;
}
}
break in else block.if($i++ > 1000) { break; } at the top of the function, saving the extra indenting. However, I suspect this won't solve the OP's problem.