Created solution to Problem 1 using PHP.