gausskruger.js is a library to convert to/from common Swedish coordinate systems and the international WGS84 standard used by most GPS devices today. It can convert RT90 <-> WGS84 and SWEREF99 <-> WGS84.

The port is more or less just a translation from JavaScript to PHP with the code encapsulated inside a class.