PHP code example of mucts / geohash

1. Go to this page and download the library: Download mucts/geohash library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mucts / geohash example snippets



    // 参数:纬度,经度,长度(可选,默认为最长)
    $geo = geo_hash_encode("69.3252", "136.2345", 9);
    echo $geo;
        
    list($lat, $lng) = geo_hash_decode($geo);
    echo $lat, ', ', $lng;