Convert PostgreSQL array to PHP array
Posted
by EarthMind
on Stack Overflow
See other posts from Stack Overflow
or by EarthMind
Published on 2010-06-18T09:59:42Z
Indexed on
2010/06/18
10:03 UTC
Read the original article
Hit count: 326
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, '{}') );
© Stack Overflow or respective owner