Solution to Project Euler Problem 1 in PHP