PHP code example of no5stranger / geohash

1. Go to this page and download the library: Download no5stranger/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/ */

    

no5stranger / geohash example snippets



Geohash\Geohash;

echo Geohash::encode(31.283131, 121.500831); // wtw3uyfjqw61


Geohash\Geohash;

list($lat, $lng) = Geohash::decode('wtw3uyfjqw61');
echo $lat, ', ', $lng; // 31.283131, 121.500831