Updated php code

took from victor's branch
Revert "Updated php code"

This reverts commit a64f54c66894a8fe5035f09a73bd6a77dc4fafd0.