- Dependencies:
sudo apt-get install libnss3-tools jq xsel
- PHP >= 5.6 :
sudo apt-get install php
- PHP Packages:
php*-cli php*-common php*-curl php*-json php*-mbstring php*-mcrypt php*-mysql php*-opcache php*-readline php*-xml php*-zip
- Optional PHP Packages:
php*-sqlite3 php*-mysql php*-pgsql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Validates a given latitude $lat | |
* | |
* @param float|int|string $lat Latitude | |
* @return bool `true` if $lat is valid, `false` if not | |
*/ | |
function validateLatitude($lat) { | |
return preg_match('/^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$/', $lat); |