If you build using the simulator (rather than using Corona Enterprise) then this:
system.getInfo( "appVersionString" )
will return the version number that you enter into the build window i.e. the second field in this image

If this is the only piece of info you need to return from your server, then I wouldn’t overcomplicate matters with databases etc (although as soon as you need to start storing and managing multiple pieces of data then using a database will be a no-brainer.
Just write the version number to a variable in the PHP script, and update that as needed. This is just a rough guide, so this probably won’t work exactly as is, but should hopefully give an idea of where to start:
–main.lua
local currentVersionNumber = system.getInfo( "appVersionString" ) local function loadGame() --do your game loading stuff here end local function networkListener( event ) if event.response then if currentVersionNumber \< event.response then local function onComplete() system.openURL( "https://play.google.com/store/apps/details?id=com.yourcompany.yourappsname" ) end native.showAlert( "New version found", "Download latest version to continue", { "OK" }, onComplete ) else loadGame() end else loadGame() end end network.request( "myServer.com/getLatestVersion.php?method=getLatestVersionNumber&OS="..system.getInfo("platformName"), "GET", networkListener, params )
YOURSERVER/classes/class_getLatestVersionNumber.php
\<?PHP class getLatestVersionNumber { /\*\* \* Constructor. \* \* \*/ function \_\_construct($args=NULL) { if(!empty($args)){ switch($args['method']){ case "getLatestVersionNumber": $this-\>\_getLatestVersionNumber( $args['OS'] ); break; default: //$this-\>\_returnRegisteredFriends(); echo "No quiz Task Provided...\n"; break; } } } private function \_getLatestVersionCatalog($OS){ $latestVersion = "unknown"; $isError = false; if($OS != "iPhone OS"){ $latestVersion = "1.0.2"; } elseif($OS != "Android"){ $latestVersion = "1.0.4"; } else{ $isError = true; } $return = array(); $return['response'] = $latestVersion; $return['isError'] = $isError; $return = json\_encode( $return); /\* Setting up JSON headers \*/ @header("content-type: text/json charset=utf-8"); echo $return; } }//end class ?\>
YOURSERVER/getLatestVersionNumber.php
\<?PHP // AUTOLOAD CLASS OBJECTS... YOU CAN USE INCLUDES IF YOU PREFER if(!function\_exists("\_\_autoload")){ function \_\_autoload($class\_name){ require\_once('classes/class\_'.$class\_name.'.php'); } } // FETCH $\_GET OR CRON ARGUMENTS TO AUTOMATE TASKS $args = (!empty($\_POST)) ? $\_POST:array('method'=\>$argv[1]); // CREATE getLatestVersionNunmber CLASS OBJECT, WITH ARGUMENTS $quiz = new getLatestVersionNumber($args); ?\>
The lua part should be fairly straight forward.
The next part is a PHP class which simply returns the version number if the OS passed in as a param is either “iPhone OS” or “Android”. You would obviously need to do something so that your sim builds worked, but this is just an example so that you can see what happens if ‘nil’ or something incorrect gets passed in.
The 3rd part is the PHP file that your network call would actually try and reach, and this file in turn calls the class described above. I’m sure that it’s not necessary to use this 2 step PHP method, but I’ve always used it without any problems and no one likes change 
You would put these files on your server. In this example, getLatestVersionNumber.php is just in the root directory. There is then a subdirectory called classes, and class_getLatestVersionNumber.php is in there.
Rob Miracle made a guide on using REST services in Corona some time ago, I’m sue that will explain the general processes slightly better: http://omnigeek.robmiracle.com/2012/04/15/using-corona-sdk-with-rest-api-services/