Derp.
Printable View
Derp.
Have you echoed the two defined variables within the function to make sure they are retrieving the correct strings?
Never mind. I changed abit and eventually it worked :)
PHP Code:define('REMOTE_VERSION', 'http://domain.com/version.txt');
// this is the version of the deployed script
$current_version = "1.0.0";
$remoteVersion = trim(file_get_contents(REMOTE_VERSION));
if($remoteVersion == $current_version) {
// yes
} elseif($remoteversion < $current_version) {
// no
}
?>
Unfortunately, that isn't going to do what you need. Because comparison will only work to the first decimal point. If you plan to do it that way, convert each period to a zero.