Measure converter for PHP