Categorized | News

Storing Data Efficiently with Bitwise Functions

Posted on 13 March 2003 by Demian Turner

I remembered reading this great article on Zend on how to store data efficiently using bitwise functions, but what a mission to dig it up again.  Anyways, here it is, a method for storing multiple true/false values as a single integer. Examples of typical applications include:

  • in an agenda, the ability to store various selected days in a week or month as a single int
  • in a form with 30 odd checkboxes, store selected as a single int
Bookmark and Share

Leave a Reply



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up