Pretty basic maths question [SOLVED]
Posted: Tue Mar 06, 2007 9:45 pm
At least I think it is. I'm useless at maths.
Anyhow, I've got an array filled with filenames, built by pulling a file list from a directory structure, and I'm using it to display files found (images) in a gallery page.
I'm pretty much set up, with 3 images across (generated thumbnails) and I'm looking at 4 rows.
So ... my simple question is, how do I go about getting the number of times 12 goes into the number of array elements without a remainder.
I mean, I can find the remainder easily enough with something like
to increase the page count to cover the extra images.
I just dont know how to get how many base pages it will take.
Any help?
Anyhow, I've got an array filled with filenames, built by pulling a file list from a directory structure, and I'm using it to display files found (images) in a gallery page.
I'm pretty much set up, with 3 images across (generated thumbnails) and I'm looking at 4 rows.
So ... my simple question is, how do I go about getting the number of times 12 goes into the number of array elements without a remainder.
I mean, I can find the remainder easily enough with something like
Code: Select all
if($img_count % 12) $page_count++;I just dont know how to get how many base pages it will take.
Any help?