Added PHP support.

Includes multimodes support, however it is not working correctly yet,
will have to fix later.