View Single Post
  #1 (permalink)  
Old Jul 5th, 2006, 13:30
rtswimmer rtswimmer is offline
New Member
Join Date: Jun 2006
Location: Portsmouth, UK
Age: 22
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
page integer problem

Basically ive written code that looks in a directory and lists all the jpeg files.
I have 13 files however i only want 12 to a page.

Code: Select all
 $pages = $files / 12;
So i want it to set $pages = 2
But it sets $pages = 1.08333333333. which is correct but i want the next integer.

So ive tried
Code: Select all
 $pages = (int) ($no / 12);
but that just sets $pages = 1



can anyone help me to find the next integer?
Reply With Quote