Archives for September, 2009

Switch Ranges in PHP


You have to admit it.
The switch statement in PHP vis-a-vis to other language counter parts is very versatile and powerful.
It has support for  switching integer as well as characters and strings.
Further, as I discovered it the other day, it also supports ranges !.
[code lang="php"]
switch(true)
{
case [...]