Found this bit of code that is designed to cause the row color to alternate but I do not understand what $i&1 does. I understand that this is causing the class to alternate but I don't understand what that small piece of code is doing.
& is a bitwise operator in PHP. It returns true if the bits of both operators are 1. It only takes into consideration the bits of the smallest operand. In this case it will only look at the least significant bit because the value 1 can be represented with a single bit. Here are some examples (all of the numbers are in binary):
10 & 1 will evaluate to 0.
11 & 1 will evaluate to 1.
101 & 10 will evaluate to 0. 11 & 10 will evaluate to 10.
Effectively, $i & 1 will return 1 when $i is odd and 0 when it is even. This is because all odd numbers end in a 1 in binary.