1. Go to this page and download the library: Download macocci7/php-photo-gps 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/ */
macocci7 / php-photo-gps example snippets
ci7\PhpPhotoGps\PhotoGps;
$filename = 'img/with_gps.jpg'; // --\n";
// Latitude in sexagesimal format
echo "Latitude: " . $pg->latitudeS() . "\n";
echo "緯度: " . $pg->lang('ja')->latitudeS() . "\n";
// Longitude in sexagesimal format
echo "Longitude: " . $pg->lang('eng')->longitudeS() . "\n";
echo "経度: " . $pg->lang('ja')->longitudeS() . "\n";
// Altitude as strings
echo "Altitude: " . $pg->lang('eng')->altitudeS() . "\n";
echo "高度: " . $pg->lang('ja')->altitudeS() . "\n";
// Coord in decimal format ('S' and 'W' results in negative value.)
echo "Coord: " . $pg->latitudeD() . ", " . $pg->longitudeD() . "\n";
ci7\PhpPhotoGps\PhotoGps;
$filename = 'img/with_gps.jpg'; // --\n";
// Format: default
echo "Current format [eng]: " . $pg->lang('eng')->format() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->format() . "\n\n";
// Latitude in sexagesimal format
echo "Latitude: " . $pg->lang('eng')->latitudeS() . "\n";
echo "緯度: " . $pg->lang('ja')->latitudeS() . "\n";
// Longitude in sexagesimal format
echo "Longitude: " . $pg->lang('eng')->longitudeS() . "\n";
echo "経度: " . $pg->lang('ja')->longitudeS() . "\n\n";
echo "[Chang format:eng]---------------------------------\n";
// Configure format
$pg->lang('eng')->format('{ref:u}: {seconds:v}{seconds:u}, {minutes:v}{minutes:u}, {degrees:v}{degrees:u}');
// Current format
echo "Current format [eng]: " . $pg->lang('eng')->format() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->format() . "\n\n";
// Latitude in sexagesimal format
echo "Latitude: " . $pg->lang('eng')->latitudeS() . "\n";
echo "緯度: " . $pg->lang('ja')->latitudeS() . "\n";
// Longitude in sexagesimal format
echo "Longitude: " . $pg->lang('eng')->longitudeS() . "\n";
echo "経度: " . $pg->lang('ja')->longitudeS() . "\n\n";
echo "[Change format:ja]---------------------------------\n";
// Configure format
$pg->lang('ja')->format('{seconds:v}{seconds:u}, {minutes:v}{minutes:u}, {degrees:v}{degrees:u} ({ref:u})');
// Current format
echo "Current format [eng]: " . $pg->lang('eng')->format() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->format() . "\n\n";
// Latitude in sexagesimal format
echo "Latitude: " . $pg->lang('eng')->latitudeS() . "\n";
echo "緯度: " . $pg->lang('ja')->latitudeS() . "\n";
// Longitude in sexagesimal format
echo "Longitude: " . $pg->lang('eng')->longitudeS() . "\n";
echo "経度: " . $pg->lang('ja')->longitudeS() . "\n\n";
echo "[Reset format:ja]---------------------------------\n";
// Reset format
$pg->lang('ja')->resetFormat();
// Current format
echo "Current format [eng]: " . $pg->lang('eng')->format() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->format() . "\n\n";
// Latitude in sexagesimal format
echo "Latitude: " . $pg->lang('eng')->latitudeS() . "\n";
echo "緯度: " . $pg->lang('ja')->latitudeS() . "\n";
// Longitude in sexagesimal format
echo "Longitude: " . $pg->lang('eng')->longitudeS() . "\n";
echo "経度: " . $pg->lang('ja')->longitudeS() . "\n\n";
ci7\PhpPhotoGps\PhotoGps;
$filename = 'img/with_gps.jpg';
$pg = new PhotoGps($filename);
echo "[" . $filename . "]--------------------\n";
// Format: default
echo "Current format [eng]: " . $pg->lang('eng')->directionFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->directionFormat() . "\n\n";
// Image Direction: default format
echo "Image Direction [eng]: " . $pg->lang('eng')->directionS() . "\n";
echo "Image Direction [ja]: " . $pg->lang('ja')->directionS() . "\n\n";
// Configure Format: eng
$pg->lang('eng')->directionFormat('{degrees:v}{degrees:u}({ref})');
// Current Format
echo "Current format [eng]: " . $pg->lang('eng')->directionFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->directionFormat() . "\n\n";
// Image Direction: Current Format
echo "Image Direction [eng]: " . $pg->lang('eng')->directionS() . "\n";
echo "Image Direction [ja]: " . $pg->lang('ja')->directionS() . "\n\n";
// Configure Format: ja
$pg->lang('ja')->directionFormat('{degrees:v}{degrees:u}');
// Reset Format: eng
$pg->lang('eng')->resetDirectionFormat();
// Current Format
echo "Current format [eng]: " . $pg->lang('eng')->directionFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->directionFormat() . "\n\n";
// Image Direction: Current Format
echo "Image Direction [eng]: " . $pg->lang('eng')->directionS() . "\n";
echo "Image Direction [ja]: " . $pg->lang('ja')->directionS() . "\n\n";
ci7\PhpPhotoGps\PhotoGps;
$filename = 'img/with_gps.jpg';
$pg = new PhotoGps($filename);
echo "[" . $filename . "]--------------------\n";
// Format: default
echo "Current format [eng]: " . $pg->lang('eng')->speedFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->speedFormat() . "\n\n";
// Speed: default format
echo "Speed [eng]: " . $pg->lang('eng')->speedS() . "\n";
echo "Speed [ja]: " . $pg->lang('ja')->speedS() . "\n\n";
// Configure Format: eng
$pg->lang('eng')->speedFormat('{speed:v}({speed:u})');
// Current Format
echo "Current format [eng]: " . $pg->lang('eng')->speedFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->speedFormat() . "\n\n";
// Speed: Current Format
echo "Speed [eng]: " . $pg->lang('eng')->speedS() . "\n";
echo "Speed [ja]: " . $pg->lang('ja')->speedS() . "\n\n";
// Configure Format: ja
$pg->lang('ja')->speedFormat('時速{speed:v}マイル');
// Reset Format: eng
$pg->lang('eng')->resetSpeedFormat();
// Current Format
echo "Current format [eng]: " . $pg->lang('eng')->speedFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->speedFormat() . "\n\n";
// Speed: Current Format
echo "Speed [eng]: " . $pg->lang('eng')->speedS() . "\n";
echo "Speed [ja]: " . $pg->lang('ja')->speedS() . "\n\n";
ci7\PhpPhotoGps\PhotoGps;
$filename = 'img/with_gps.jpg';
$pg = new PhotoGps($filename);
echo "[" . $filename . "]--------------------\n";
// Format: default
echo "Current format [eng]: " . $pg->lang('eng')->datestampFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->datestampFormat() . "\n\n";
// Datestamp: default format
echo "Datestamp [eng]: " . $pg->lang('eng')->datestamp() . "\n";
echo "Datestamp [ja]: " . $pg->lang('ja')->datestamp() . "\n\n";
// Configure Format: eng
$pg->lang('eng')->datestampFormat('l jS \of F Y');
// Current Format
echo "Current format [eng]: " . $pg->lang('eng')->datestampFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->datestampFormat() . "\n\n";
// Datestamp: Current Format
echo "Datestamp [eng]: " . $pg->lang('eng')->datestamp() . "\n";
echo "Datestamp [ja]: " . $pg->lang('ja')->datestamp() . "\n\n";
// Configure Format: ja
$pg->lang('ja')->datestampFormat('n月j日(\'y)');
// Reset Format: eng
$pg->lang('eng')->resetDatestampFormat();
// Current Format
echo "Current format [eng]: " . $pg->lang('eng')->datestampFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->datestampFormat() . "\n\n";
// Datestamp: Current Format
echo "Datestamp [eng]: " . $pg->lang('eng')->datestamp() . "\n";
echo "Datestamp [ja]: " . $pg->lang('ja')->datestamp() . "\n\n";
ci7\PhpPhotoGps\PhotoGps;
$filename = 'img/with_gps.jpg';
$pg = new PhotoGps($filename);
echo "[" . $filename . "]--------------------\n";
// Format: default
echo "Current format [eng]: " . $pg->lang('eng')->timestampFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->timestampFormat() . "\n\n";
// Timestamp: default format
echo "Timestamp [eng]: " . $pg->lang('eng')->timestamp() . "\n";
echo "Timestamp [ja]: " . $pg->lang('ja')->timestamp() . "\n\n";
// Configure Format: eng
$pg->lang('eng')->timestampFormat('g:i a');
// Current Format
echo "Current format [eng]: " . $pg->lang('eng')->timestampFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->timestampFormat() . "\n\n";
// Timestamp: Current Format
echo "Timestamp [eng]: " . $pg->lang('eng')->timestamp() . "\n";
echo "Timestamp [ja]: " . $pg->lang('ja')->timestamp() . "\n\n";
// Configure Format: ja
$pg->lang('ja')->timestampFormat('G時i分s秒');
// Reset Format: eng
$pg->lang('eng')->resetTimestampFormat();
// Current Format
echo "Current format [eng]: " . $pg->lang('eng')->timestampFormat() . "\n";
echo "Current format [ja]: " . $pg->lang('ja')->timestampFormat() . "\n\n";
// Timestamp: Current Format
echo "Timestamp [eng]: " . $pg->lang('eng')->timestamp() . "\n";
echo "Timestamp [ja]: " . $pg->lang('ja')->timestamp() . "\n\n";