Setup

Setting up convertor could not be simpler.

Include the library in your project and you are good to go!

include("Convertor.php");

Convert A Unit

To convert a unit, create an instance of Convertor passsing two arguments to the constructor. The first argument is the value to be converted from, the second argument is a case sensitive string representing its unit. This returns a Convertor object that will refrenece all its conversions to your initial unit and value.

You can then call the to() function on the Convertor object, passing the desired output unit as the first argument.

$demoConvertor = new Convertor(10, "m");
$demoConvertor->to("ft"); //returns converted value

Result: 10 Meters = 32.808398950131 Feet

A full list of available units can be found in the Available Units section.