introduced php

did some phpwork, made adaptiveness better