Solve problems 31,35 using PHP.