$data[‘version’] = “2.0.3.4.2”;
$res[‘version’] = “2.0.3.4.3”;
verListA=explode(′.′,(string)verListA = explode('.', (string)verListA=explode(′.′,(string)data[‘version’]); //当前软件版本
verListB=explode(′.′,(string)verListB = explode('.', (string)verListB=explode(′.′,(string)res[‘version’]); //数据库版本
len=max(count(len = max(count(len=max(count(verListA),count($verListB));
i=−1;while(i = -1;
while (i=−1;while(i++<$len) {
echo $i;
verListA[verListA[verListA[i] = intval(@verListA[verListA[verListA[i]);
if (verListA[verListA[verListA[i] < 0 ) {
verListA[verListA[verListA[i] = 0; //软件版本号
}
verListB[verListB[verListB[i] = intval(@verListB[verListB[verListB[i]);
if (verListB[verListB[verListB[i] < 0 ) {
verListB[verListB[verListB[i] = 0; //数据库版本
}
if (verListA[verListA[verListA[i]>verListB[verListB[verListB[i]) {
KaTeX parse error: Expected 'EOF', got '}' at position 53: …/版本大小大于数据库
}̲else if (verListA[i]<i]<i]<verListB[$i]) {
KaTeX parse error: Expected 'EOF', got '}' at position 58: …数据库 提供更新
}̲ else if (i==($len-1)) {
$status = false; //循环完毕,没发现大或者小则相等,不更新
break;
}
}