PHP code for problem 10