added PHP implimentation