Convert PostgreSQL array to PHP array
- by EarthMind
I have trouble reading Postgresql arrays in PHP. I have tried explode(), but this breaks arrays containing commas in strings, and str_getcsv() but it's also no good as PostgreSQL doesn't quote the Japanese strings.
Not working:
explode(',', trim($pgArray, '{}'));
str_getcsv( trim($pgArray, '{}') );