PHP code for problem 11