Postgresql Get Index Of Array Php