1. Go to this page and download the library: Download tuupola/whereami 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/ */
tuupola / whereami example snippets
use Whereami\Provider\MozillaProvider;
use Whereami\Scanner\AirportScanner;
use Whereami\Whereami;
$provider = new MozillaProvider("your-api-key-here");
$scanner = new AirportScanner;
$locator = new Whereami($provider, $scanner);
$location = $locator->whereami();
/*
Array
(
[latitude] => 1.355989
[longitude] => 103.992365
[accuracy] => 65
)
*/
use Whereami\Provider\MozillaProvider;
use Whereami\Whereami;
$provider = new MozillaProvider("your-api-key-here");
$locator = new Whereami($provider);
$location = $locator->whereami();
use Whereami\Provider\CombainProvider;
$provider = new CombainProvider("your-api-key-here");
use Whereami\Provider\GoogleProvider;
$provider = new GoogleProvider("your-api-key-here");
use Whereami\Provider\BrowserlocationProvider;
$provider = new BrowserlocationProvider(null);
use Whereami\Provider\MozillaProvider;
$provider = new MozillaProvider("your-api-key-here");
use Whereami\Provider\RadiocellsProvider;
$provider = new RadiocellsProvider(null);
use Whereami\Provider\UnwiredProvider;
$provider = new UnwiredProvider("your-api-key-here");
use Whereami\Scanner\AirportScanner;
$scanner = new AirportScanner("/tmp/airport --scan 2>&1");
use Whereami\Scanner\IwlistScanner;
$scanner = new IwlistScanner;
use Whereami\Scanner\IwlistScanner;
$scanner = new IwlistScanner("cat /tmp/iwlist.txt");
use Whereami\Adapter\CoreLocationAdapter;
use Whereami\Whereami;
$adapter = new CoreLocationAdapter;
$locator = new Whereami($adapter);
$location = $locator->whereami();
use Whereami\Adapter\CoreLocationAdapter;
$adapter = new CoreLocationAdapter;
use Whereami\Adapter\LocateMeAdapter;
$adapter = new LocateMeAdapter;
apache ALL=(ALL) NOPASSWD: /sbin/iwlist
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.