Solve problem 5 using PHP.