PHP code example of longitude-one / geo-parser
1. Go to this page and download the library: Download longitude-one/geo-parser 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/ */
longitude-one / geo-parser example snippets
$input = '79°56′55″W, 40°26′46″N';
$parser = new Parser($input);
$value = $parser->parse(); // [-79.948611111111, 40.446111111111]
$input1 = '56.242 E';
$input2 = '40:26:46 S';
$parser = new Parser();
$value1 = $parser->parse($input1); //56.242
$value2 = $parser->parse($input2); //-40.446111111111