由于我在 PHP 上比我希望的更“菜鸟”,是否可以反转以下函数,例如:
public function baseID($resourceid){
$rid = $resourceid;
$version = 0;
while ($rid > 16777216){
$version++;
if ($version == 1){
//the constant applied to all items
$rid -= 1342177280;
}elseif ($version == 2){
//the value added to the first updated version
$rid -= 50331648;
}else{
//the value added on all subsequent versions
$rid -= 16777216;
}
}
//$returnable = array('baseID'=>$rid,'version'=>$version);
return $rid;
}
是否可以输入“baseID”并返回“resourceID”而不是当前方式?
如果问这个问题的地方不对,我深表歉意