Add a solution to EP6 in PHP