achieved complete php functionality