将 PostgreSQL 点转换为"(5.035,1)"
to格式的最有效方法是{x: 5.035, y: 1}
什么?
我用 PHP 写的函数看起来像
function pointToArray($point) {
if ( strlen($point) == 0 ) return null;
$xy = explode(",", substr($point, 1, strlen($point)-2));
return array(
"x" => $xy[0],
"y" => $xy[1]
);
}