no5stranger / geohash
geohash package
v1.0
2018-08-20 06:39 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: ~3.7
This package is not auto-updated.
Last update: 2024-12-18 11:46:43 UTC
README
Simple php geohash class
Install
You may install Geohash with Composer (recommended) or manually.
require: { "geohash/geohash": "dev-master" }
Usage
Encode a coordinates:
<?php require "vendor/autoload.php"; use Geohash\Geohash; echo Geohash::encode(31.283131, 121.500831); // wtw3uyfjqw61
Decode a geohash:
<?php require "vendor/autoload.php"; use Geohash\Geohash; list($lat, $lng) = Geohash::decode('wtw3uyfjqw61'); echo $lat, ', ', $lng; // 31.283131, 121.500831