parse an array returned from postgres into a PHP array