added php functionality - daniel
merged abduls code