I couldn't convert postgresql array to php array. Here is my array column is character varying[] and here are the values {image1,image2,image3}
$imgArry always null.
$query = "SELECT \"A\".\"id\",
array_to_json(\"A\".images)
FROM
public.A " ;
$rs = pg_query($db, $query) or
die("Cannot execute query: $query\n");
$index = 0;
while ($row = pg_fetch_assoc($rs)) {
$A->id = $row["id"];
$imgArry = json_decode($row["images"]);
$planproduct->image=$imgArry[0];