Posts Tagged ‘class’

New Script: PHP Length Conversion Class

Sunday, February 10th, 2008

I was looking for a project to tackle today, and I decided to make a script that would convert lengths from one unit or system to another.

It doesn’t sound all that complicated – and it’s not. I had a working script in a few minutes, but I didn’t like it. It had too many functions to do conversions for individual units. I wanted this script to be pretty well abstracted so that I could easily add new unit types – and so that the source code for the class would be very short.
(more…)