Yes, as David notices it is SQL function and not pg/PlSQL (you haveprobably misread this).
I wonder what to do with the string in PHP, how to convert it to an(2-dimensional) array.