PHP class for conversion