Solve problems 46-47 using PHP.