Created solution to Problem 5 using PHP.