Convert MySQL's POINT to text in PHP Convert MySQL's POINT to text in PHP php php

Convert MySQL's POINT to text in PHP


Finally I've got this working!!!

I had to use unpack in order to extract the binary data from MySQL

$point_value = $data_from_db["point_field"];$coordinates = unpack('x/x/x/x/corder/Ltype/dlat/dlon', $point_value);echo $coordinates['lat'];echo $coordinates['lon'];

Here is a tutotial that helped me with this issue