Results 1 to 2 of 2
Feb 20, 2012, 08:16 #1
- Join Date
- Jun 2010
- 0 Post(s)
- 0 Thread(s)
Dynamically count the remain of items max 5 per line
i have many categories, each category have one or more items inside it. i'm displaying each category and its items under it in lines with max number of items per line.
(the data coming from database dynamically).
item1 item2 item3 item4 item5
Using PHP how to know the remain numbers of items in the line [ If i have 2 items under the category how to know that it remains 3 to complete the line and if i have 1 item under the category, how to know that it remains 4 to complete the line and so on]
i want to know how many items remains in the row.
i do not know how many categories or items exist.
please i want it as quikly as possible
Feb 20, 2012, 12:07 #2
Your English is difficult to understand.
If you want the remainder, you use the modulus (%), so $count % 5 = 2, means the last row will have 2 items.