开发者

php syntax error on line 5

    <?php

$vc=$开发者_如何学Go_POST['versioncode'];

if ($vc == 1.0.2){

echo 1;  // for correct version code

} else {

echo 0; // for incorrect version code

}
?>

I get this error. Parse error: syntax error, unexpected T_DNUMBER in /hermes/bosweb26b/b865/ipg.synamegamescom/giveaway/versioncheck.php on line 5


You need to quote 1.0.2 as it is not a valid number (T_DNUMBER):

if ($vc == '1.0.2') {
  ...
}

I'd also encourage you to look at version_compare()


if ($vc == 1.0.2){

1.0.2 is not a valid number. Probably you need to compare it as a string '1.0.2' like:

if ($vc == '1.0.2'){


You should use: if ($vc == "1.0.2") { ... }


1.0.2 is not a valid number. You should treat it as a string instead:

if ($vc == '1.0.2') {...}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜