Sunday, February 17, 2013

Even or odd number validation with PHP

The other day, while I was writing up some PHP code, I ran into a really cool way of identifying if a number is even or odd (refer to the link further down below). I needed it as I looped the creation of a couple of divs and wanted the odd numbered ones to be floated left, the evens to the right.