- make a web request like this url: https://domain .com/updatecheck.php?version={CLIENT_VERSION}
- version parameter must int or double eg: 1,22,13,40 or 1.2.3.4
Last active
April 28, 2018 18:07
-
-
Save relliv/de97172a6a2cf04dbe99a54794c2016b to your computer and use it in GitHub Desktop.
PHP Basic Update Check Example
This file contains hidden or 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 | |
// app current version | |
$appversiyon = "2.2"; | |
if($_GET["version"]){ | |
// GET client vresion | |
$client_version = $_GET["version"]; | |
// compare with app version | |
if($appversiyon > $client_version){ | |
// if client version is lower, say OK for updates | |
echo "OK"; | |
} | |
// if app version is lower, say RETURN | |
else if($appversiyon < $client_version){ | |
echo "RETURN"; | |
} | |
// if they are equals | |
else if($appversiyon == $client_version){ | |
// there is no update | |
echo "NO"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment