Postgresql Split Array Php Use For Loop