BFFs solutions

BFFs was solved using PHP by 2 contestants. Solution sizes: average 2525 bytes (shortest: 1840; longest: 3211).