Postgresql Get Data From Array Php To Json In Php