我正在做一个积分系统。我制作了一个数组来保存升级所需的点,但它不起作用。
这是代码:
$level_stats = array();
$level_stats[1] = 50;
$level_stats[2] = 100;
$level_stats[3] = 175;
$level_stats[4] = 250;
$level_stats[5] = 350;
$level_stats[6] = 500;
$level_stats[7] = 700;
$level_stats[8] = 950;
$level_stats[9] = 1250;
$level_stats[10] = 2000;
function getLevelRequirementForUser($name){ // function to get needed points to level up
$level = tonumber(getLevelForUser($name)); // returns 1 (function not shown in code, it works though)
return $level_stats[$level]; // returns nothing.
}