Postgres Loop Through Array Php Functions String Of Pearls