我已经有了这个脚本来缩小哪个页码的版本ID似乎在大多数情况下起作用,但是当我输入0013作为数字时它应该说它的pageNum = 311但它总是以261返回。
我做错了吗?
以下是脚本:
$releaseNumber = sprintf('%04d', 0013);
if($releaseNumber < 6300 && $releaseNumber > 6000) {
$pageNum = 1;
}elseif($releaseNumber < 6001 && $releaseNumber > 5800) {
$pageNum = 16;
}elseif($releaseNumber < 5801 && $releaseNumber > 5600) {
$pageNum = 26;
}elseif($releaseNumber < 5601 && $releaseNumber > 5200) {
$pageNum = 36;
}elseif($releaseNumber < 5201 && $releaseNumber > 5000) {
$pageNum = 56;
}elseif($releaseNumber < 5001 && $releaseNumber > 4700) {
$pageNum = 66;
}elseif($releaseNumber < 4701 && $releaseNumber > 4300) {
$pageNum = 81;
}elseif($releaseNumber < 4301 && $releaseNumber > 3900) {
$pageNum = 101;
}elseif($releaseNumber < 3901 && $releaseNumber > 3500) {
$pageNum = 121;
}elseif($releaseNumber < 3501 && $releaseNumber > 3100) {
$pageNum = 141;
}elseif($releaseNumber < 3101 && $releaseNumber > 2700) {
$pageNum = 161;
}elseif($releaseNumber < 2701 && $releaseNumber > 2300) {
$pageNum = 181;
}elseif($releaseNumber < 2301 && $releaseNumber > 1900) {
$pageNum = 201;
}elseif($releaseNumber < 1901 && $releaseNumber > 1500) {
$pageNum = 221;
}elseif($releaseNumber < 1501 && $releaseNumber > 1100) {
$pageNum = 241;
}elseif($releaseNumber < 1101 && $releaseNumber > 0900) {
$pageNum = 261;
}elseif($releaseNumber < 0901 && $releaseNumber > 0700) {
$pageNum = 271;
}elseif($releaseNumber < 0701 && $releaseNumber > 0500) {
$pageNum = 281;
}elseif($releaseNumber < 0501 && $releaseNumber > 0301) {
$pageNum = 291;
}elseif($releaseNumber < 0301 && $releaseNumber > 0100) {
$pageNum = 301;
}elseif($releaseNumber < 0101 && $releaseNumber > 0000) {
$pageNum = 311;
}
答案 0 :(得分:1)
答案 1 :(得分:1)