Reputation: 11
I am using PHP have an array with 100 keys, and I want to echo all the keys, however, I want to add a
after displaying every 10th key: keys 1-10 (0-9), 11-20, 21-30...so on.
Upvotes: 0
Views: 205
Reputation: 48897
You'll want to use the Modulus operator:
if (!($key % 10)) {
// page break
}
Upvotes: 2